This is Hibernate cartridge, isn't it? It would be nice if we all try prefix the posts related to a specific cartridge with the cartridge name. /Patrik
Jeroen Bernards wrote: > > Hi all, > > I noticed that when I model a one-to-many association that the resulting > ddl file contains 2 fields for on the ‘many side’ that reference the > ‘one-side’ (OWNER and owners_TO_pets): > > create table pets ( > ID bigint not null, > NAME varchar(255) not null, > BIRTHDATE date not null, > TYPE bigint not null unique, > OWNER bigint not null, > owners_TO_pets bigint, > primary key (ID) > ) type=InnoDB; > > In the Hibernate mapping files I found that the name of the key column of > the set has a different name than the property’s column name on the ‘one > side’. > > Owner mapping: > <set name="pets" lazy="true" access="property" cascade="save-update"> > <key> > <column name="owners_TO_pets" not-null="false"/> > </key> > <one-to-many class="org.springframework.samples.petclinic.PetImpl"/> > </set> > > > Pet mapping: > <many-to-one name="owner" column="OWNER" > class="org.springframework.samples.petclinic.OwnerImpl" access="property" > not-null="true" cascade="save-update" unique="false"/> > > The result is that 'owners_TO_pets' doesn't get a value when I add a pet > to a owner while owner does. A new object is stored in the database but > there is no way to retrieve it, because Hibernate uses owners_TO_pet to > retrieve related pets. > > Is this a bug or do I have to model things differently? > > Jeroen. > > -- View this message in context: http://www.nabble.com/one-to-many-association-tf4311219s17564.html#a12288146 Sent from the Fornax-Platform mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Fornax-developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fornax-developer
