Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/test Modified Files: A.java ABCProxyTest.java ABCTest.java Abstract.java AbstractProxy.java B.java Bar.java BarProxy.java BasicNameable.java Baz.java C1.java C2.java Category.java Child.java Circular.java Contained.java Container.java Custom.java CustomPersister.java D.java DemoTest.java Detail.java DoubleStringType.java Fee.java Fo.java Foo.java FooBarTest.java FooComponent.java FooProxy.java FooStatus.java Fum.java FumCompositeID.java Fumm.java Glarch.java GlarchProxy.java Holder.java Immutable.java LessSimple.java Location.java Many.java Master.java MasterDetailTest.java MoreStuff.java Multi.java MultiTableTest.java Nameable.java Named.java NewPerformanceTest.java ODMGTest.java One.java Parent.java ParentChildTest.java PerformanceTest.java Po.java Qux.java ReverseComparator.java SQLFunctionsTest.java Several.java Simple.java Single.java Stuff.java SubDetail.java SubMulti.java TestCase.java Trivial.java Vetoer.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: A.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/A.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** A.java 1 Jan 2003 13:56:43 -0000 1.1.1.1 --- A.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 5,9 **** private Long id; private String name; ! /** * Returns the id. --- 5,9 ---- private Long id; private String name; ! /** * Returns the id. *************** *** 13,17 **** return id; } ! /** * Returns the name. --- 13,17 ---- return id; } ! /** * Returns the name. *************** *** 21,25 **** return name; } ! /** * Sets the id. --- 21,25 ---- return name; } ! /** * Sets the id. *************** *** 29,33 **** this.id = id; } ! /** * Sets the name. --- 29,33 ---- this.id = id; } ! /** * Sets the name. *************** *** 37,40 **** this.name = name; } ! } --- 37,43 ---- this.name = name; } ! } + + + Index: ABCProxyTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABCProxyTest.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ABCProxyTest.java 1 Jan 2003 13:56:43 -0000 1.1.1.1 --- ABCProxyTest.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 14,18 **** super(arg0); } ! public void testSubclassing() throws Exception { Session s = sessions.openSession(); --- 14,18 ---- super(arg0); } ! public void testSubclassing() throws Exception { Session s = sessions.openSession(); *************** *** 37,45 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); B c1b = (B) s.load( B.class, c1.getId() ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") --- 37,45 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); B c1b = (B) s.load( B.class, c1.getId() ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") *************** *** 47,55 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 47,55 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 65,69 **** assertTrue( c1a.getName().equals("c1") ); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 65,69 ---- assertTrue( c1a.getName().equals("c1") ); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 72,76 **** ); c1b = (B) s.load( B.class, c1.getId() ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") --- 72,76 ---- ); c1b = (B) s.load( B.class, c1.getId() ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") *************** *** 79,83 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); --- 79,83 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); *************** *** 85,89 **** assertTrue( c1a.getName().equals("c1") ); c1 = (C1) s.load( C1.class, c1.getId(), LockMode.UPGRADE ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 85,89 ---- assertTrue( c1a.getName().equals("c1") ); c1 = (C1) s.load( C1.class, c1.getId(), LockMode.UPGRADE ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 92,96 **** ); c1b = (B) s.load( B.class, c1.getId(), LockMode.UPGRADE ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") --- 92,96 ---- ); c1b = (B) s.load( B.class, c1.getId(), LockMode.UPGRADE ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") *************** *** 99,103 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); --- 99,103 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); *************** *** 106,110 **** c1b = (B) s.load( B.class, c1.getId() ); assertTrue( c1a.getName().equals("c1") ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 106,110 ---- c1b = (B) s.load( B.class, c1.getId() ); assertTrue( c1a.getName().equals("c1") ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 112,116 **** c1.getD().getAmount()>213.3f ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") --- 112,116 ---- c1.getD().getAmount()>213.3f ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") *************** *** 118,122 **** t.commit(); s.close(); ! } --- 118,122 ---- t.commit(); s.close(); ! } *************** *** 132,135 **** --- 132,138 ---- } } + + + Index: ABCTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABCTest.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ABCTest.java 1 Jan 2003 13:56:43 -0000 1.1.1.1 --- ABCTest.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 14,18 **** super(arg0); } ! public void testSubclassing() throws Exception { Session s = sessions.openSession(); --- 14,18 ---- super(arg0); } ! public void testSubclassing() throws Exception { Session s = sessions.openSession(); *************** *** 37,41 **** t = s.beginTransaction(); c1 = (C1) s.load( A.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 37,41 ---- t = s.beginTransaction(); c1 = (C1) s.load( A.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 45,53 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( B.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 45,53 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( B.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 57,65 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 57,65 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 82,85 **** --- 82,88 ---- } } + + + Index: Abstract.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Abstract.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Abstract.java 1 Jan 2003 13:56:43 -0000 1.1.1.1 --- Abstract.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 5,27 **** public abstract class Abstract extends Foo implements AbstractProxy { ! private java.sql.Time time; private Set abstracts; ! public java.sql.Time getTime() { return time; } ! public void setTime(java.sql.Time time) { this.time = time; } ! public Set getAbstracts() { return abstracts; } ! public void setAbstracts(Set abstracts) { this.abstracts = abstracts; } ! } --- 5,30 ---- public abstract class Abstract extends Foo implements AbstractProxy { ! private java.sql.Time time; private Set abstracts; ! public java.sql.Time getTime() { return time; } ! public void setTime(java.sql.Time time) { this.time = time; } ! public Set getAbstracts() { return abstracts; } ! public void setAbstracts(Set abstracts) { this.abstracts = abstracts; } ! } + + + Index: AbstractProxy.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/AbstractProxy.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AbstractProxy.java 1 Jan 2003 13:56:44 -0000 1.1.1.1 --- AbstractProxy.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 6,8 **** public void setTime(java.sql.Time arg0); public java.sql.Time getTime(); ! } \ No newline at end of file --- 6,10 ---- public void setTime(java.sql.Time arg0); public java.sql.Time getTime(); ! } ! ! Index: B.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/B.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** B.java 1 Jan 2003 13:56:45 -0000 1.1.1.1 --- B.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 11,15 **** return count; } ! /** * Sets the count. --- 11,15 ---- return count; } ! /** * Sets the count. *************** *** 19,22 **** this.count = count; } ! } --- 19,25 ---- this.count = count; } ! } + + + Index: Bar.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Bar.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Bar.java 1 Jan 2003 13:56:45 -0000 1.1.1.1 --- Bar.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 6,30 **** private FooComponent barComponent = new FooComponent("bar", 69, null, null); private Baz baz; ! public String getBarString() { return barString; } ! void setBarString(String barString) { this.barString = barString; } ! public FooComponent getBarComponent() { return barComponent; } ! public void setBarComponent(FooComponent barComponent) { this.barComponent = barComponent; } ! public Baz getBaz() { return baz; } ! public void setBaz(Baz baz) { this.baz = baz; --- 6,30 ---- private FooComponent barComponent = new FooComponent("bar", 69, null, null); private Baz baz; ! public String getBarString() { return barString; } ! void setBarString(String barString) { this.barString = barString; } ! public FooComponent getBarComponent() { return barComponent; } ! public void setBarComponent(FooComponent barComponent) { this.barComponent = barComponent; } ! public Baz getBaz() { return baz; } ! public void setBaz(Baz baz) { this.baz = baz; *************** *** 32,44 **** public String name = "bar"; ! public String getName() { return name; } ! public void setName(String name) { this.name = name; } ! } --- 32,47 ---- public String name = "bar"; ! public String getName() { return name; } ! public void setName(String name) { this.name = name; } ! } + + + Index: BarProxy.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/BarProxy.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** BarProxy.java 1 Jan 2003 13:56:45 -0000 1.1.1.1 --- BarProxy.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 9,11 **** //public void setBarString(String arg0); public String getBarString(); ! } \ No newline at end of file --- 9,13 ---- //public void setBarString(String arg0); public String getBarString(); ! } ! ! Index: BasicNameable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/BasicNameable.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** BasicNameable.java 1 Jan 2003 13:56:45 -0000 1.1.1.1 --- BasicNameable.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 11,15 **** private String name; private Long id; ! /** * @see net.sf.hibernate.test.Nameable#getName() --- 11,15 ---- private String name; private Long id; ! /** * @see net.sf.hibernate.test.Nameable#getName() *************** *** 18,22 **** return name; } ! /** * @see net.sf.hibernate.test.Nameable#setName() --- 18,22 ---- return name; } ! /** * @see net.sf.hibernate.test.Nameable#setName() *************** *** 25,29 **** name = n; } ! /** * @see net.sf.hibernate.test.Nameable#getKey() --- 25,29 ---- name = n; } ! /** * @see net.sf.hibernate.test.Nameable#getKey() *************** *** 32,36 **** return id; } ! /** * @see net.sf.hibernate.test.Nameable#setKey() --- 32,36 ---- return id; } ! /** * @see net.sf.hibernate.test.Nameable#setKey() *************** *** 39,42 **** id = k; } ! } --- 39,45 ---- id = k; } ! } + + + Index: Baz.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Baz.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Baz.java 1 Jan 2003 13:56:46 -0000 1.1.1.1 --- Baz.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 66,70 **** this.stringArray = stringArray; } ! public String getCode() { return Code; --- 66,70 ---- this.stringArray = stringArray; } ! public String getCode() { return Code; *************** *** 93,101 **** customs.add( new String[] { "A", "B" } ); customs.add( new String[] { "1", "2" } ); ! fooSet = new HashSet(); ! components = new FooComponent[] { ! new FooComponent("foo", 42, null, null), ! new FooComponent("bar", 88, null, new FooComponent("sub", 69, null, null) ) }; timeArray = new Date[] { new Date(), new Date(), null, new Date(0) }; --- 93,101 ---- customs.add( new String[] { "A", "B" } ); customs.add( new String[] { "1", "2" } ); ! fooSet = new HashSet(); ! components = new FooComponent[] { ! new FooComponent("foo", 42, null, null), ! new FooComponent("bar", 88, null, new FooComponent("sub", 69, null, null) ) }; timeArray = new Date[] { new Date(), new Date(), null, new Date(0) }; *************** *** 104,108 **** TreeSet a = new TreeSet(); a.add("a"); a.add("b"); a.add("d"); a.add("c"); ! count = 667; name="Bazza"; --- 104,108 ---- TreeSet a = new TreeSet(); a.add("a"); a.add("b"); a.add("d"); a.add("c"); ! count = 667; name="Bazza"; *************** *** 117,121 **** bag.add("unique"); } ! public List getCustoms() { return customs; --- 117,121 ---- bag.add("unique"); } ! public List getCustoms() { return customs; *************** *** 124,128 **** this.customs = customs; } ! public Set getFooSet() { return fooSet; --- 124,128 ---- this.customs = customs; } ! public Set getFooSet() { return fooSet; *************** *** 131,135 **** this.fooSet = fooSet; } ! public FooComponent[] getComponents() { return components; --- 131,135 ---- this.fooSet = fooSet; } ! public FooComponent[] getComponents() { return components; *************** *** 138,162 **** this.components = components; } ! public Date[] getTimeArray() { return timeArray; } ! public void setTimeArray(Date[] timeArray) { this.timeArray = timeArray; } ! public int getCount() { return count; } ! public void setCount(int count) { this.count = count; } ! public String getName() { return name; } ! public void setName(String name) { this.name = name; --- 138,162 ---- this.components = components; } ! public Date[] getTimeArray() { return timeArray; } ! public void setTimeArray(Date[] timeArray) { this.timeArray = timeArray; } ! public int getCount() { return count; } ! public void setCount(int count) { this.count = count; } ! public String getName() { return name; } ! public void setName(String name) { this.name = name; *************** *** 166,231 **** return topComponents; } ! public void setTopComponents(List topComponents) { this.topComponents = topComponents; } ! public Collection getBag() { return bag; } ! public void setBag(Collection bag) { this.bag = bag; } ! public Set getTopFoos() { return topFoos; } ! public void setTopFoos(Set topFoos) { this.topFoos = topFoos; } ! ! public Map getTopGlarchez() { return topGlarchez; } ! public void setTopGlarchez(Map topGlarchez) { this.topGlarchez = topGlarchez; } ! public Set getCascadingBars() { return cascadingBars; } ! public void setCascadingBars(Set cascadingBars) { this.cascadingBars = cascadingBars; } ! public Map getFooToGlarch() { return fooToGlarch; } ! public void setFooToGlarch(Map fooToGlarch) { this.fooToGlarch = fooToGlarch; } ! public Map getFooComponentToFoo() { return fooComponentToFoo; } ! public void setFooComponentToFoo(Map fooComponentToFoo) { this.fooComponentToFoo = fooComponentToFoo; } ! public Map getGlarchToFoo() { return glarchToFoo; } ! public void setGlarchToFoo(Map glarchToFoo) { this.glarchToFoo = glarchToFoo; } ! } --- 166,234 ---- return topComponents; } ! public void setTopComponents(List topComponents) { this.topComponents = topComponents; } ! public Collection getBag() { return bag; } ! public void setBag(Collection bag) { this.bag = bag; } ! public Set getTopFoos() { return topFoos; } ! public void setTopFoos(Set topFoos) { this.topFoos = topFoos; } ! ! public Map getTopGlarchez() { return topGlarchez; } ! public void setTopGlarchez(Map topGlarchez) { this.topGlarchez = topGlarchez; } ! public Set getCascadingBars() { return cascadingBars; } ! public void setCascadingBars(Set cascadingBars) { this.cascadingBars = cascadingBars; } ! public Map getFooToGlarch() { return fooToGlarch; } ! public void setFooToGlarch(Map fooToGlarch) { this.fooToGlarch = fooToGlarch; } ! public Map getFooComponentToFoo() { return fooComponentToFoo; } ! public void setFooComponentToFoo(Map fooComponentToFoo) { this.fooComponentToFoo = fooComponentToFoo; } ! public Map getGlarchToFoo() { return glarchToFoo; } ! public void setGlarchToFoo(Map glarchToFoo) { this.glarchToFoo = glarchToFoo; } ! } + + + Index: C1.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/C1.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** C1.java 1 Jan 2003 13:56:46 -0000 1.1.1.1 --- C1.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 12,16 **** return address; } ! /** * Sets the address. --- 12,16 ---- return address; } ! /** * Sets the address. *************** *** 20,24 **** this.address = address; } ! /** * Returns the d. --- 20,24 ---- this.address = address; } ! /** * Returns the d. *************** *** 28,32 **** return d; } ! /** * Sets the d. --- 28,32 ---- return d; } ! /** * Sets the d. *************** *** 36,39 **** this.d = d; } ! } --- 36,42 ---- this.d = d; } ! } + + + Index: C2.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/C2.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** C2.java 1 Jan 2003 13:56:46 -0000 1.1.1.1 --- C2.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 11,15 **** return address; } ! /** * Sets the address. --- 11,15 ---- return address; } ! /** * Sets the address. *************** *** 19,22 **** this.address = address; } ! } --- 19,25 ---- this.address = address; } ! } + + + Index: Category.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Category.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Category.java 1 Jan 2003 13:56:46 -0000 1.1.1.1 --- Category.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 6,10 **** /** ! * */ public class Category { --- 6,10 ---- /** ! * */ public class Category { *************** *** 22,26 **** return id; } ! /** * Sets the id. --- 22,26 ---- return id; } ! /** * Sets the id. *************** *** 30,34 **** this.id = id; } ! /** * Returns the subcategories. --- 30,34 ---- this.id = id; } ! /** * Returns the subcategories. *************** *** 38,42 **** return subcategories; } ! /** * Sets the subcategories. --- 38,42 ---- return subcategories; } ! /** * Sets the subcategories. *************** *** 46,50 **** this.subcategories = subcategories; } ! /** * Returns the name. --- 46,50 ---- this.subcategories = subcategories; } ! /** * Returns the name. *************** *** 54,58 **** return name; } ! /** * Sets the name. --- 54,58 ---- return name; } ! /** * Sets the name. *************** *** 62,65 **** this.name = name; } ! } --- 62,68 ---- this.name = name; } ! } + + + Index: Child.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Child.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Child.java 1 Jan 2003 13:56:47 -0000 1.1.1.1 --- Child.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 3,7 **** public class Child { ! private Parent parent; private int count; --- 3,7 ---- public class Child { ! private Parent parent; private int count; *************** *** 9,24 **** return parent; } ! ! public void setParent(Parent parent) { this.parent = parent; } ! public int getCount() { return count; } ! ! public void setCount(int count) { this.count = count; --- 9,24 ---- return parent; } ! ! public void setParent(Parent parent) { this.parent = parent; } ! public int getCount() { return count; } ! ! public void setCount(int count) { this.count = count; *************** *** 30,34 **** private void setId(long id) { } ! } --- 30,37 ---- private void setId(long id) { } ! } + + + Index: Circular.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Circular.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Circular.java 1 Jan 2003 13:56:47 -0000 1.1.1.1 --- Circular.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 15,19 **** super(); } ! /** * Returns the clazz. --- 15,19 ---- super(); } ! /** * Returns the clazz. *************** *** 23,27 **** return clazz; } ! /** * Returns the id. --- 23,27 ---- return clazz; } ! /** * Returns the id. *************** *** 31,35 **** return id; } ! /** * Sets the clazz. --- 31,35 ---- return id; } ! /** * Sets the clazz. *************** *** 39,43 **** this.clazz = clazz; } ! /** * Sets the id. --- 39,43 ---- this.clazz = clazz; } ! /** * Sets the id. *************** *** 47,51 **** this.id = id; } ! /** * Returns the other. --- 47,51 ---- this.id = id; } ! /** * Returns the other. *************** *** 55,59 **** return other; } ! /** * Sets the other. --- 55,59 ---- return other; } ! /** * Sets the other. *************** *** 63,67 **** this.other = other; } ! /** * Returns the anyEntity. --- 63,67 ---- this.other = other; } ! /** * Returns the anyEntity. *************** *** 71,75 **** return anyEntity; } ! /** * Sets the anyEntity. --- 71,75 ---- return anyEntity; } ! /** * Sets the anyEntity. *************** *** 79,82 **** this.anyEntity = anyEntity; } ! } --- 79,85 ---- this.anyEntity = anyEntity; } ! } + + + Index: Contained.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Contained.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Contained.java 1 Jan 2003 13:56:47 -0000 1.1.1.1 --- Contained.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 17,21 **** return new Long(id).hashCode(); } ! /** * Returns the container. --- 17,21 ---- return new Long(id).hashCode(); } ! /** * Returns the container. *************** *** 25,29 **** return container; } ! /** * Returns the id. --- 25,29 ---- return container; } ! /** * Returns the id. *************** *** 33,37 **** return id; } ! /** * Sets the container. --- 33,37 ---- return id; } ! /** * Sets the container. *************** *** 41,45 **** this.container = container; } ! /** * Sets the id. --- 41,45 ---- this.container = container; } ! /** * Sets the id. *************** *** 49,53 **** this.id = id; } ! /** * Returns the bag. --- 49,53 ---- this.id = id; } ! /** * Returns the bag. *************** *** 57,61 **** return bag; } ! /** * Sets the bag. --- 57,61 ---- return bag; } ! /** * Sets the bag. *************** *** 65,69 **** this.bag = bag; } ! /** * Returns the lazyBag. --- 65,69 ---- this.bag = bag; } ! /** * Returns the lazyBag. *************** *** 73,77 **** return lazyBag; } ! /** * Sets the lazyBag. --- 73,77 ---- return lazyBag; } ! /** * Sets the lazyBag. *************** *** 81,84 **** this.lazyBag = lazyBag; } ! } --- 81,87 ---- this.lazyBag = lazyBag; } ! } + + + Index: Container.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Container.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Container.java 1 Jan 2003 13:56:48 -0000 1.1.1.1 --- Container.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 15,23 **** private One one; private Many many; ! public void setSimple(Simple simple) { this.simple = simple; } ! public Simple getSimple() { return simple; --- 15,23 ---- private One one; private Many many; ! public void setSimple(Simple simple) { this.simple = simple; } ! public Simple getSimple() { return simple; *************** *** 30,34 **** return name; } ! /** * Sets the name. --- 30,34 ---- return name; } ! /** * Sets the name. *************** *** 41,49 **** public String toString() { return name + " = " + simple.getCount() ! + "/" + ( one==null ? "nil" : Long.toString( one.getKey() ) ) ! + "/" + ( many==null ? "nil" : Long.toString( many.getKey() ) ); } ! ! /** * Returns the one. --- 41,49 ---- public String toString() { return name + " = " + simple.getCount() ! + "/" + ( one==null ? "nil" : Long.toString( one.getKey() ) ) ! + "/" + ( many==null ? "nil" : Long.toString( many.getKey() ) ); } ! ! /** * Returns the one. *************** *** 53,57 **** return one; } ! /** * Sets the one. --- 53,57 ---- return one; } ! /** * Sets the one. *************** *** 61,65 **** this.one = one; } ! /** * Returns the many. --- 61,65 ---- this.one = one; } ! /** * Returns the many. *************** *** 69,73 **** return many; } ! /** * Sets the many. --- 69,73 ---- return many; } ! /** * Sets the many. *************** *** 77,81 **** this.many = many; } ! } --- 77,81 ---- this.many = many; } ! } *************** *** 89,93 **** private Map ternaryMap; private Set ternarySet; ! /** * Constructor for Container. --- 89,93 ---- private Map ternaryMap; private Set ternarySet; ! /** * Constructor for Container. *************** *** 96,100 **** super(); } ! /** * Returns the components. --- 96,100 ---- super(); } ! /** * Returns the components. *************** *** 104,108 **** return components; } ! /** * Returns the manyToMany. --- 104,108 ---- return components; } ! /** * Returns the manyToMany. *************** *** 112,116 **** return manyToMany; } ! /** * Returns the oneToMany. --- 112,116 ---- return manyToMany; } ! /** * Returns the oneToMany. *************** *** 120,124 **** return oneToMany; } ! /** * Sets the components. --- 120,124 ---- return oneToMany; } ! /** * Sets the components. *************** *** 128,132 **** this.components = components; } ! /** * Sets the manyToMany. --- 128,132 ---- this.components = components; } ! /** * Sets the manyToMany. *************** *** 136,140 **** this.manyToMany = manyToMany; } ! /** * Sets the oneToMany. --- 136,140 ---- this.manyToMany = manyToMany; } ! /** * Sets the oneToMany. *************** *** 144,148 **** this.oneToMany = oneToMany; } ! /** * Returns the id. --- 144,148 ---- this.oneToMany = oneToMany; } ! /** * Returns the id. *************** *** 152,156 **** return id; } ! /** * Sets the id. --- 152,156 ---- return id; } ! /** * Sets the id. *************** *** 160,164 **** this.id = id; } ! /** * Gets the composites. --- 160,164 ---- this.id = id; } ! /** * Gets the composites. *************** *** 168,172 **** return composites; } ! /** * Sets the composites. --- 168,172 ---- return composites; } ! /** * Sets the composites. *************** *** 176,180 **** this.composites = composites; } ! /** * Returns the bag. --- 176,180 ---- this.composites = composites; } ! /** * Returns the bag. *************** *** 184,188 **** return bag; } ! /** * Sets the bag. --- 184,188 ---- return bag; } ! /** * Sets the bag. *************** *** 192,196 **** this.bag = bag; } ! /** * Returns the ternary. --- 192,196 ---- this.bag = bag; } ! /** * Returns the ternary. *************** *** 200,204 **** return ternaryMap; } ! /** * Sets the ternary. --- 200,204 ---- return ternaryMap; } ! /** * Sets the ternary. *************** *** 220,224 **** return foo; } ! /** * Returns the glarch. --- 220,224 ---- return foo; } ! /** * Returns the glarch. *************** *** 228,232 **** return glarch; } ! /** * Returns the name. --- 228,232 ---- return glarch; } ! /** * Returns the name. *************** *** 236,240 **** return name; } ! /** * Sets the foo. --- 236,240 ---- return name; } ! /** * Sets the foo. *************** *** 244,248 **** this.foo = foo; } ! /** * Sets the glarch. --- 244,248 ---- this.foo = foo; } ! /** * Sets the glarch. *************** *** 252,256 **** this.glarch = glarch; } ! /** * Sets the name. --- 252,256 ---- this.glarch = glarch; } ! /** * Sets the name. *************** *** 260,266 **** this.name = name; } ! } ! /** * Returns the ternarySet. --- 260,266 ---- this.name = name; } ! } ! /** * Returns the ternarySet. *************** *** 270,274 **** return ternarySet; } ! /** * Sets the ternarySet. --- 270,274 ---- return ternarySet; } ! /** * Sets the ternarySet. *************** *** 278,282 **** this.ternarySet = ternarySet; } ! /** * Returns the lazyBag. --- 278,282 ---- this.ternarySet = ternarySet; } ! /** * Returns the lazyBag. *************** *** 286,290 **** return lazyBag; } ! /** * Sets the lazyBag. --- 286,290 ---- return lazyBag; } ! /** * Sets the lazyBag. *************** *** 294,297 **** this.lazyBag = lazyBag; } ! } --- 294,300 ---- this.lazyBag = lazyBag; } ! } + + + Index: Custom.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Custom.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Custom.java 1 Jan 2003 13:56:49 -0000 1.1.1.1 --- Custom.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 16,17 **** --- 16,20 ---- } } + + + Index: CustomPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/CustomPersister.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CustomPersister.java 1 Jan 2003 13:56:49 -0000 1.1.1.1 --- CustomPersister.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 32,43 **** public CustomPersister(PersistentClass model, SessionFactoryImplementor factory) {} ! /** * @see net.sf.hibernate.persister.ClassPersister#postInstantiate(SessionFactoryImplementor) */ public void postInstantiate(SessionFactoryImplementor factory) ! throws MappingException { } ! /** * @see net.sf.hibernate.persister.ClassPersister#getMappedClass() --- 32,43 ---- public CustomPersister(PersistentClass model, SessionFactoryImplementor factory) {} ! /** * @see net.sf.hibernate.persister.ClassPersister#postInstantiate(SessionFactoryImplementor) */ public void postInstantiate(SessionFactoryImplementor factory) ! throws MappingException { } ! /** * @see net.sf.hibernate.persister.ClassPersister#getMappedClass() *************** *** 46,50 **** return Custom.class; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getClassName() --- 46,50 ---- return Custom.class; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getClassName() *************** *** 53,57 **** return Custom.class.getName(); } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCompositeKey() --- 53,57 ---- return Custom.class.getName(); } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCompositeKey() *************** *** 60,64 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsPersistentLifecycle() --- 60,64 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsPersistentLifecycle() *************** *** 67,71 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsLifecycle() --- 67,71 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsLifecycle() *************** *** 74,78 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsValidatable() --- 74,78 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsValidatable() *************** *** 81,85 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasProxy() --- 81,85 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasProxy() *************** *** 88,92 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getProxyInterfaces() --- 88,92 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getProxyInterfaces() *************** *** 95,99 **** return null; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCollections() --- 95,99 ---- return null; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCollections() *************** *** 102,106 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCascades() --- 102,106 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCascades() *************** *** 109,113 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isMutable() --- 109,113 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isMutable() *************** *** 116,120 **** return true; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isIdentifierAssignedByInsert() --- 116,120 ---- return true; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isIdentifierAssignedByInsert() *************** *** 123,127 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isUnsaved(Serializable) --- 123,127 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isUnsaved(Serializable) *************** *** 130,169 **** return ( (Long) id ).longValue()==0; } ! /** * @see net.sf.hibernate.persister.ClassPersister#setPropertyValues(Object, Object[]) */ public void setPropertyValues(Object object, Object[] values) ! throws HibernateException { ! Custom c = (Custom) object; ! c.name = (String) values[0]; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getPropertyValues(Object) */ public Object[] getPropertyValues(Object object) ! throws HibernateException { Custom c = (Custom) object; return new Object[] { c.name }; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getPropertyValue(Object, int) */ public Object getPropertyValue(Object obj, int i) ! throws HibernateException { return ( (Custom) obj ).name; } ! /** * @see net.sf.hibernate.persister.ClassPersister#setPropertyValue(Object, int, Object) */ public void setPropertyValue(Object obj, int i, Object val) ! throws HibernateException { ( (Custom) obj ).name = (String) val; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isDirty(Object[], Object[], Object, SessionImplementor) --- 130,169 ---- return ( (Long) id ).longValue()==0; } ! /** * @see net.sf.hibernate.persister.ClassPersister#setPropertyValues(Object, Object[]) */ public void setPropertyValues(Object object, Object[] values) ! throws HibernateException { ! Custom c = (Custom) object; ! c.name = (String) values[0]; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getPropertyValues(Object) */ public Object[] getPropertyValues(Object object) ! throws HibernateException { Custom c = (Custom) object; return new Object[] { c.name }; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getPropertyValue(Object, int) */ public Object getPropertyValue(Object obj, int i) ! throws HibernateException { return ( (Custom) obj ).name; } ! /** * @see net.sf.hibernate.persister.ClassPersister#setPropertyValue(Object, int, Object) */ public void setPropertyValue(Object obj, int i, Object val) ! throws HibernateException { ( (Custom) obj ).name = (String) val; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isDirty(Object[], Object[], Object, SessionImplementor) *************** *** 175,436 **** SessionImplementor session) throws HibernateException { ! if ( !ObjectUtils.equals( x[0], y[0] ) ) { ! return new int[] { 0 }; } ! else { ! return null; } ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasIdentifierProperty() ! */ ! public boolean hasIdentifierProperty() { ! return true; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifier(Object) ! */ ! public Serializable getIdentifier(Object object) throws HibernateException { ! return new Long( ( (Custom) object ).id ); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#setIdentifier(Object, Serializable) ! */ ! public void setIdentifier(Object object, Serializable id) throws HibernateException { ! ( (Custom) object ).id = ( (Long) id ).longValue(); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getProxyGetIdentifierMethod() ! */ ! public Method getProxyGetIdentifierMethod() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#isVersioned() ! */ ! public boolean isVersioned() { ! return false; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersionType() ! */ ! public VersionType getVersionType() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersionProperty() ! */ ! public int getVersionProperty() { ! return 0; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersion(Object) ! */ ! public Object getVersion(Object object) throws HibernateException { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#instantiate(Serializable) ! */ ! public Object instantiate(Serializable id) throws HibernateException { ! Custom c = new Custom(); ! c.id = ( (Long) id ).longValue(); ! return c; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierGenerator() ! */ ! public IdentifierGenerator getIdentifierGenerator() ! throws HibernateException { ! return idgen; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#load(Serializable, Object, boolean, SessionImplementor) ! */ ! public Object load( ! Serializable id, ! Object optionalObject, ! LockMode lockMode, ! SessionImplementor session) ! throws HibernateException, SQLException { ! // fails when optional object is supplied ! Custom clone = null; ! Custom obj = (Custom) instances.get(id); ! if (obj!=null) { ! clone = (Custom) obj.clone(); ! session.addUninitializedEntity( new Key(id, this), clone, LockMode.NONE ); ! session.postHydrate(this, id, new String[] { obj.name }, clone, LockMode.NONE); ! session.initializeEntity(clone); } - return clone; - } - - /** - * @see net.sf.hibernate.persister.ClassPersister#lockForUpdate(Serializable, Object, SessionImplementor) - */ - public void lock( - Serializable id, - Object version, - Object object, - LockMode lockMode, - SessionImplementor session) - throws HibernateException, SQLException { - - throw new UnsupportedOperationException(); - } - - /** - * @see net.sf.hibernate.persister.ClassPersister#insert(Serializable, Object[], SessionImplementor) - */ - public void insert( - Serializable id, - Object[] fields, - Object object, - SessionImplementor session) - throws SQLException, HibernateException { - - instances.put(id, ( (Custom) object ).clone() ); - } - - /** - * @see net.sf.hibernate.persister.ClassPersister#insert(Object[], SessionImplementor) - */ - public Serializable insert(Object[] fields, Object object, SessionImplementor session) - throws SQLException, HibernateException { - - throw new UnsupportedOperationException(); - } - - /** - * @see net.sf.hibernate.persister.ClassPersister#delete(Serializable, Object, SessionImplementor) - */ - public void delete( - Serializable id, - Object version, - Object object, - SessionImplementor session) - throws SQLException, HibernateException { ! instances.remove(id); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#update(Serializable, Object[], Object, SessionImplementor) ! */ ! public void update( ! Serializable id, ! Object[] fields, ! int[] dirtyFields, ! Object oldVersion, ! Object object, ! SessionImplementor session) ! throws SQLException, HibernateException { ! instances.put( id, ( (Custom) object ).clone() ); ! } ! ! Type[] TYPES = new Type[] { Hibernate.STRING }; ! String[] NAMES = new String[] { "name" }; ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyTypes() ! */ ! public Type[] getPropertyTypes() { ! return TYPES; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyNames() ! */ ! public String[] getPropertyNames() { ! return NAMES; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyCascadeStyles() ! */ ! public Cascades.CascadeStyle[] getPropertyCascadeStyles() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierType() ! */ ! public Type getIdentifierType() { ! return Hibernate.LONG; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierPropertyName() ! */ ! public String getIdentifierPropertyName() { ! return "id"; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasCache() ! */ ! public boolean hasCache() { ! return false; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getCache() ! */ ! public CacheConcurrencyStrategy getCache() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierSpace() ! */ ! public Serializable getIdentifierSpace() { ! return "CUSTOMS"; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertySpaces(Object) ! */ ! public Serializable[] getPropertySpaces(Object instance) { ! return new String[] { "CUSTOMS" }; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getClassMetadata() ! */ ! public ClassMetadata getClassMetadata() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasSubclasses() ! */ ! public boolean hasSubclasses() { ! return false; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getConcreteProxyClass() ! */ ! public Class getConcreteProxyClass() { ! return Custom.class; ! } ! ! } --- 175,439 ---- SessionImplementor session) throws HibernateException { ! if ( !ObjectUtils.equals( x[0], y[0] ) ) { ! return new int[] { 0 }; ! } ! else { ! return null; ! } } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasIdentifierProperty() ! */ ! public boolean hasIdentifierProperty() { ! return true; } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifier(Object) ! */ ! public Serializable getIdentifier(Object object) throws HibernateException { ! return new Long( ( (Custom) object ).id ); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#setIdentifier(Object, Serializable) ! */ ! public void setIdentifier(Object object, Serializable id) throws HibernateException { ! ( (Custom) object ).id = ( (Long) id ).longValue(); ! } ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getProxyGetIdentifierMethod() ! */ ! public Method getProxyGetIdentifierMethod() { ! return null; ! } ! /** ! * @see net.sf.hibernate.persister.ClassPersister#isVersioned() ! */ ! public boolean isVersioned() { ! return false; } ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersionType() ! */ ! public VersionType getVersionType() { ! return null; ! } ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersionProperty() ! */ ! public int getVersionProperty() { ! return 0; ! } ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersion(Object) ! */ ! public Object getVersion(Object object) throws HibernateException { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#instantiate(Serializable) ! */ ! public Object instantiate(Serializable id) throws HibernateException { ! Custom c = new Custom(); ! c.id = ( (Long) id ).longValue(); ! return c; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierGenerator() ! */ ! public IdentifierGenerator getIdentifierGenerator() ! throws HibernateException { ! return idgen; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#load(Serializable, Object, boolean, SessionImplementor) ! */ ! public Object load( ! Serializable id, ! Object optionalObject, ! LockMode lockMode, ! SessionImplementor session) ! throws HibernateException, SQLException { ! ! // fails when optional object is supplied ! ! Custom clone = null; ! Custom obj = (Custom) instances.get(id); ! if (obj!=null) { ! clone = (Custom) obj.clone(); ! session.addUninitializedEntity( new Key(id, this), clone, LockMode.NONE ); ! session.postHydrate(this, id, new String[] { obj.name }, clone, LockMode.NONE); ! session.initializeEntity(clone); ! } ! return clone; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#lockForUpdate(Serializable, Object, SessionImplementor) ! */ ! public void lock( ! Serializable id, ! Object version, ! Object object, ! LockMode lockMode, ! SessionImplementor session) ! throws HibernateException, SQLException { ! ! throw new UnsupportedOperationException(); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#insert(Serializable, Object[], SessionImplementor) ! */ ! public void insert( ! Serializable id, ! Object[] fields, ! Object object, ! SessionImplementor session) ! throws SQLException, HibernateException { ! ! instances.put(id, ( (Custom) object ).clone() ); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#insert(Object[], SessionImplementor) ! */ ! public Serializable insert(Object[] fields, Object object, SessionImplementor session) ! throws SQLException, HibernateException { ! ! throw new UnsupportedOperationException(); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#delete(Serializable, Object, SessionImplementor) ! */ ! public void delete( ! Serializable id, ! Object version, ! Object object, ! SessionImplementor session) ! throws SQLException, HibernateException { ! ! instances.remove(id); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#update(Serializable, Object[], Object, SessionImplementor) ! */ ! public void update( ! Serializable id, ! Object[] fields, ! int[] dirtyFields, ! Object oldVersion, ! Object object, ! SessionImplementor session) ! throws SQLException, HibernateException { ! ! instances.put( id, ( (Custom) object ).clone() ); ! ! } ! ! Type[] TYPES = new Type[] { Hibernate.STRING }; ! String[] NAMES = new String[] { "name" }; ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyTypes() ! */ ! public Type[] getPropertyTypes() { ! return TYPES; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyNames() ! */ ! public String[] getPropertyNames() { ! return NAMES; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyCascadeStyles() ! */ ! public Cascades.CascadeStyle[] getPropertyCascadeStyles() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierType() ! */ ! public Type getIdentifierType() { ! return Hibernate.LONG; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierPropertyName() ! */ ! public String getIdentifierPropertyName() { ! return "id"; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasCache() ! */ ! public boolean hasCache() { ! return false; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getCache() ! */ ! public CacheConcurrencyStrategy getCache() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierSpace() ! */ ! public Serializable getIdentifierSpace() { ! return "CUSTOMS"; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertySpaces(Object) ! */ ! public Serializable[] getPropertySpaces(Object instance) { ! return new String[] { "CUSTOMS" }; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getClassMetadata() ! */ ! public ClassMetadata getClassMetadata() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasSubclasses() ! */ ! public boolean hasSubclasses() { ! return false; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getConcreteProxyClass() ! */ ! public Class getConcreteProxyClass() { ! return Custom.class; ! } ! ! } ! ! ! Index: D.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/D.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** D.java 1 Jan 2003 13:56:51 -0000 1.1.1.1 --- D.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 11,15 **** return amount; } ! /** * Returns the id. --- 11,15 ---- return amount; } ! /** * Returns the id. *************** *** 19,23 **** return id; } ! /** * Sets the amount. --- 19,23 ---- return id; } ! /** * Sets the amount. *************** *** 27,31 **** this.amount = amount; } ! /** * Sets the id. --- 27,31 ---- this.amount = amount; } ! /** * Sets the id. *************** *** 35,38 **** this.id = id; } ! } --- 35,41 ---- this.id = id; } ! } + + + Index: DemoTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/DemoTest.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** DemoTest.java 1 Jan 2003 13:56:51 -0000 1.1.1.1 --- DemoTest.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 6,10 **** public class DemoTest extends TestCase { ! public DemoTest(String arg0) { super(arg0); --- 6,10 ---- public class DemoTest extends TestCase { ! public DemoTest(String arg0) { super(arg0); *************** *** 40,46 **** } ! ! public static void main(String[] args) { } } --- 40,49 ---- } ! ! public static void main(String[] args) { } } + + + Index: Detail.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Detail.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Detail.java 1 Jan 2003 13:56:51 -0000 1.1.1.1 --- Detail.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 14,30 **** return master; } ! public void setMaster(Master master) { this.master = master; } ! public int getI() { return i; } ! public void setI(int i) { this.i = i; } ! /** * Returns the details. --- 14,30 ---- return master; } ! public void setMaster(Master master) { this.master = master; } ! public int getI() { return i; } ! public void setI(int i) { this.i = i; } ! /** * Returns the details. *************** *** 34,38 **** return details; } ! /** * Sets the details. --- 34,38 ---- return details; } ! /** * Sets the details. *************** *** 42,45 **** this.details = details; } ! } --- 42,48 ---- this.details = details; } ! } + + + Index: DoubleStringType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/DoubleStringType.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** DoubleStringType.java 1 Jan 2003 13:56:52 -0000 1.1.1.1 --- DoubleStringType.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 12,26 **** public class DoubleStringType implements UserType { ! private static final int[] TYPES = { Types.VARCHAR, Types.VARCHAR }; ! public int[] sqlTypes() { ! return TYPES; } ! public Class returnedClass() { return String[].class; } ! public boolean equals(Object x, Object y) { if (x==y) return true; --- 12,26 ---- public class DoubleStringType implements UserType { ! private static final int[] TYPES = { Types.VARCHAR, Types.VARCHAR }; ! public int[] sqlTypes() { ! return TYPES; } ! public Class returnedClass() ... [truncated message content] |