From: <one...@us...> - 2002-12-19 11:54:22
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv25439/hibernate/persister Modified Files: MultiTableEntityPersister.java Log Message: fixed up another bug in normalized mappings Index: MultiTableEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/MultiTableEntityPersister.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** MultiTableEntityPersister.java 19 Dec 2002 11:29:03 -0000 1.44 --- MultiTableEntityPersister.java 19 Dec 2002 11:54:19 -0000 1.45 *************** *** 112,119 **** if ( type.isEntityType() ) { String path = (String) e.getKey(); String[] columns = (String[]) columnNamesByPropertyPath.get(path); EntityType etype = (EntityType) type; Type idType = factory.getIdentifierType( etype.getPersistentClass() ); - Object table = tableNumberByPropertyPath.get(path); String idpath = path + '.' + PathExpressionParser.ENTITY_ID; --- 112,124 ---- if ( type.isEntityType() ) { String path = (String) e.getKey(); + Object table = tableNumberByPropertyPath.get(path); String[] columns = (String[]) columnNamesByPropertyPath.get(path); + if ( columns.length==0 ) { + //ie. a one-to-one association + columns = getIdentifierColumnNames(); + table = new Integer(0); + } EntityType etype = (EntityType) type; Type idType = factory.getIdentifierType( etype.getPersistentClass() ); String idpath = path + '.' + PathExpressionParser.ENTITY_ID; |