Author: dgeraskov
Date: 2009-11-12 03:18:16 -0500 (Thu, 12 Nov 2009)
New Revision: 18636
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5189
Do not forget to add id-property of RootClass as property for SingleTableSubclass(as it
doesn't need the id-property and we don't want to forget the id-property)
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2009-11-12
02:12:28 UTC (rev 18635)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2009-11-12
08:18:16 UTC (rev 18636)
@@ -169,7 +169,11 @@
pc = getMappedSuperclass(project, pcCopy, (RootClass) entry.getValue());
Subclass subclass = null;
if (pc != null){
- subclass = new JoinedSubclass(pc);
+ if (pc.isAbstract()){
+ subclass = new SingleTableSubclass(pc);
+ } else {
+ subclass = new JoinedSubclass(pc);
+ }
} else {
pc = getMappedImplementedInterface(project, pcCopy, (RootClass) entry.getValue());
if (pc != null){
@@ -185,6 +189,10 @@
if (subclass instanceof JoinedSubclass) {
((JoinedSubclass) subclass).setTable(new
Table(pastClass.getClassName().toUpperCase()));
((JoinedSubclass) subclass).setKey((KeyValue)
pc.getIdentifierProperty().getValue());
+ } else {
+ if (pastClass.getIdentifierProperty() != null) {
+ subclass.addProperty(pastClass.getIdentifierProperty());
+ }
}
Iterator it = pastClass.getPropertyIterator();
while (it.hasNext()) {