Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping
In directory sc8-pr-cvs1:/tmp/cvs-serv9385/sf/hibernate/mapping
Modified Files:
RootClass.java Subclass.java
Log Message:
fixed bug in generated SQL for loading <joined-subclass>es
Index: RootClass.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/RootClass.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** RootClass.java 22 Jan 2003 13:09:19 -0000 1.7
--- RootClass.java 24 Jan 2003 13:07:17 -0000 1.8
***************
*** 89,94 ****
Node tableNameNode = atts.getNamedItem("table");
String tableName = (tableNameNode==null) ?
! StringHelper.unqualify( getPersistentClass().getName() ) :
! tableNameNode.getNodeValue();
Node schemaNode = atts.getNamedItem("schema");
--- 89,94 ----
Node tableNameNode = atts.getNamedItem("table");
String tableName = (tableNameNode==null) ?
! StringHelper.unqualify( getPersistentClass().getName() ) :
! tableNameNode.getNodeValue();
Node schemaNode = atts.getNamedItem("schema");
Index: Subclass.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Subclass.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Subclass.java 20 Jan 2003 12:48:13 -0000 1.6
--- Subclass.java 24 Jan 2003 13:07:17 -0000 1.7
***************
*** 90,98 ****
NamedNodeMap atts = node.getAttributes();
! //TABLENAME
! Node tableNameNode = atts.getNamedItem("table");
// TODO: split this class into 2 different subclasses
// one for joined, one for "normal" (same table)
! if (tableNameNode==null) {
//ordinary subclasses
--- 90,97 ----
NamedNodeMap atts = node.getAttributes();
! String mappingStyle = node.getNodeName();
// TODO: split this class into 2 different subclasses
// one for joined, one for "normal" (same table)
! if ( "subclass".equals(mappingStyle) ) {
//ordinary subclasses
***************
*** 105,108 ****
--- 104,109 ----
else {
+ Node tableNameNode = atts.getNamedItem("table");
+
if ( getPersister()==null ) {
getRootClass().setPersister(NormalizedEntityPersister.class);
***************
*** 110,114 ****
// joined subclasses
! String tableName = tableNameNode.getNodeValue();
Node schemaNode = atts.getNamedItem("schema");
String schema = schemaNode==null ? root.getSchemaName() : schemaNode.getNodeValue();
--- 111,117 ----
// joined subclasses
! String tableName = (tableNameNode==null) ?
! StringHelper.unqualify( getPersistentClass().getName() ) :
! tableNameNode.getNodeValue();
Node schemaNode = atts.getNamedItem("schema");
String schema = schemaNode==null ? root.getSchemaName() : schemaNode.getNodeValue();
|