Knud Müller
2005-02-22 14:38:47 UTC
Hi all,
I am just evaluating middlegen, especially the hibernate plugin.
Starting yesterday, I got after a workday a complex Domain Model up and
running - thats quite encouraging.
Although I know that sooner or later there will be some deeper look into the
hibernate plugin neccessary, there are some question which appeal so generic
to me, that I really wonder why I did'nt manage to find any documentation
about it.
1. I would like to use hibernate components
- An address has an geo-coordinate (latitude, longitude)
- My database table has the columns latitude, longitude
- My POJO's are generated (hbm2java) with getter and setters for
latitude/longitude
I would like to generate a getter and setter for a component called Point,
which encapsulates latitude and longitude.
How can I manage to use the hibernate-component with automatic code
generation, without writing my own cartridge and without postprocessing?
2. Lists with a sort column
- There is a one to many association using a foreign key between the tables
Member and Address 1:n (A member can have n addresses)
- Address are sorted for a member. Therefore java.util.List should be used
instead of java.util.Set, using a certain integer sort column called
'sort_no'.
How can I manage to get in certain cases java.util.List instead of Sets in a
one to many relationship?
Thank you all in advance,
Alex
I am just evaluating middlegen, especially the hibernate plugin.
Starting yesterday, I got after a workday a complex Domain Model up and
running - thats quite encouraging.
Although I know that sooner or later there will be some deeper look into the
hibernate plugin neccessary, there are some question which appeal so generic
to me, that I really wonder why I did'nt manage to find any documentation
about it.
1. I would like to use hibernate components
- An address has an geo-coordinate (latitude, longitude)
- My database table has the columns latitude, longitude
- My POJO's are generated (hbm2java) with getter and setters for
latitude/longitude
I would like to generate a getter and setter for a component called Point,
which encapsulates latitude and longitude.
How can I manage to use the hibernate-component with automatic code
generation, without writing my own cartridge and without postprocessing?
2. Lists with a sort column
- There is a one to many association using a foreign key between the tables
Member and Address 1:n (A member can have n addresses)
- Address are sorted for a member. Therefore java.util.List should be used
instead of java.util.Set, using a certain integer sort column called
'sort_no'.
How can I manage to get in certain cases java.util.List instead of Sets in a
one to many relationship?
Thank you all in advance,
Alex