From: <epb...@us...> - 2006-02-16 12:52:16
|
Update of /cvsroot/hibernate/HibernateExt/metadata/src/test/org/hibernate/test/annotations/id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14316/metadata/src/test/org/hibernate/test/annotations/id Modified Files: Ball.java IdTest.java Log Message: Better test Index: Ball.java =================================================================== RCS file: /cvsroot/hibernate/HibernateExt/metadata/src/test/org/hibernate/test/annotations/id/Ball.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Ball.java 3 Jan 2006 09:41:01 -0000 1.4 +++ Ball.java 16 Feb 2006 12:52:09 -0000 1.5 @@ -7,6 +7,7 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.TableGenerator; +import javax.persistence.Column; /** * Sample of table generator @@ -19,6 +20,7 @@ private Integer id; @Id @GeneratedValue(strategy = GenerationType.TABLE, generator = "EMP_GEN") + @Column(name="ball_id") public Integer getId() { return id; } Index: IdTest.java =================================================================== RCS file: /cvsroot/hibernate/HibernateExt/metadata/src/test/org/hibernate/test/annotations/id/IdTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- IdTest.java 15 Feb 2006 22:29:28 -0000 1.8 +++ IdTest.java 16 Feb 2006 12:52:09 -0000 1.9 @@ -3,6 +3,7 @@ import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.mapping.Column; import org.hibernate.test.annotations.TestCase; /** @@ -43,6 +44,7 @@ public void testTableGenerator() throws Exception { Session s = openSession(); Transaction tx = s.beginTransaction(); + Ball b = new Ball(); Dog d = new Dog(); Computer c = new Computer(); @@ -218,6 +220,12 @@ s.close(); } + public void testColumnDefinition() { + Column idCol = (Column) getCfg().getClassMapping( Ball.class.getName() ).getIdentifierProperty().getValue() + .getColumnIterator().next(); + assertEquals( "ball_id", idCol.getName() ); + } + /** * @see org.hibernate.test.annotations.TestCase#getMappings() */ |