1. Hibernate Annotations, specifying which members of a component to make persistent stackoverflow.comI have a Price object consisting of two MonetaryValues where one MonetaryValue consists of an amount and a currency. If I configure the OR-mapping the XML-way, I can do this
|
2. Using persistent object as component inside other object forum.hibernate.orgThis is my situation: Code: /** * @hibernate.class */ public class Person { } /** * @hibernate.class */ public class Organisation { /** * @hibernate.set cascade="all" lazy="true" inverse="true" * @hibernate.collection-key column="organisationId" * @hibernate.collection-one-to-many class="Person" */ public Set getEmployees() { } } /** * ... |
3. Component Mapping with component persisted to its own table forum.hibernate.orgAs I have mentioned in my first post, if join type mapping then, this means that I divide One class into 2 or more tables. What I wanted to do is to have 2 classes and 2 tables. Not 1 class and 2 tables(JOIN) OR 2 classes and 1 table(Component mapping) 1-1 mapping is the closest to what I want, but ... |