From: <one...@us...> - 2002-11-22 00:27:12
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv22494/hibernate/test Modified Files: Multi.hbm.xml Multi.java SubMulti.java Log Message: fixed a couple of bugs in multitable mappings fixed an npe in CalendarType Index: Multi.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Multi.hbm.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Multi.hbm.xml 5 Nov 2002 13:40:53 -0000 1.13 --- Multi.hbm.xml 22 Nov 2002 00:27:09 -0000 1.14 *************** *** 30,36 **** --- 30,46 ---- <many-to-one name="other" column="other2" class="cirrus.hibernate.test.Multi" /> + <component name="comp" class="cirrus.hibernate.test.Multi$Component"> + <property name="cal"/> + <property name="floaty"/> + </component> + <joined-subclass name="cirrus.hibernate.test.SubMulti" table="submulti"> <key column="sid"/> <property name="amount"/> + <bag role="children" lazy="true" readonly="true"> + <key column="parent"/> + <one-to-many class="cirrus.hibernate.test.SubMulti"/> + </bag> + <many-to-one name="parent"/> </joined-subclass> Index: Multi.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Multi.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Multi.java 28 Sep 2002 16:04:57 -0000 1.1 --- Multi.java 22 Nov 2002 00:27:09 -0000 1.2 *************** *** 2,5 **** --- 2,7 ---- package cirrus.hibernate.test; + import java.util.Calendar; + public class Multi extends Simple { *************** *** 12,15 **** --- 14,18 ---- private String extraProp; + private Component comp; /** *************** *** 27,30 **** --- 30,86 ---- public void setExtraProp(String extraProp) { this.extraProp = extraProp; + } + + public static final class Component { + private Calendar cal; + private Float floaty; + /** + * Returns the cal. + * @return Calendar + */ + public Calendar getCal() { + return cal; + } + + /** + * Sets the cal. + * @param cal The cal to set + */ + public void setCal(Calendar cal) { + this.cal = cal; + } + + /** + * Returns the floaty. + * @return Float + */ + public Float getFloaty() { + return floaty; + } + + /** + * Sets the floaty. + * @param floaty The floaty to set + */ + public void setFloaty(Float floaty) { + this.floaty = floaty; + } + + } + + /** + * Returns the comp. + * @return Component + */ + public Component getComp() { + return comp; + } + + /** + * Sets the comp. + * @param comp The comp to set + */ + public void setComp(Component comp) { + this.comp = comp; } Index: SubMulti.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/SubMulti.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SubMulti.java 11 Oct 2002 04:56:57 -0000 1.1 --- SubMulti.java 22 Nov 2002 00:27:09 -0000 1.2 *************** *** 2,7 **** --- 2,11 ---- package cirrus.hibernate.test; + import java.util.List; + public class SubMulti extends Multi { private float amount; + private SubMulti parent; + private List children; /** * Returns the amount. *************** *** 18,21 **** --- 22,57 ---- public void setAmount(float amount) { this.amount = amount; + } + + /** + * Returns the childen. + * @return List + */ + public List getChildren() { + return children; + } + + /** + * Returns the parent. + * @return SubMulti + */ + public SubMulti getParent() { + return parent; + } + + /** + * Sets the childen. + * @param childen The childen to set + */ + public void setChildren(List children) { + this.children = children; + } + + /** + * Sets the parent. + * @param parent The parent to set + */ + public void setParent(SubMulti parent) { + this.parent = parent; } |