Author: mdryakhlenkov
Date: 2007-06-27 12:06:14 -0400 (Wed, 27 Jun 2007)
New Revision: 2194
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmLabelProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmModelNameVisitor.java
Log:
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmLabelProvider.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmLabelProvider.java 2007-06-27
16:05:30 UTC (rev 2193)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmLabelProvider.java 2007-06-27
16:06:14 UTC (rev 2194)
@@ -32,6 +32,7 @@
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.SimpleValue;
+import org.hibernate.mapping.SingleTableSubclass;
import org.hibernate.mapping.Table;
/**
@@ -104,6 +105,13 @@
} else {
return name;
}
+ } else if (element instanceof SingleTableSubclass) {
+ String name =
(String)ormModelNameVisitor.visitPersistentClass((SingleTableSubclass)element, null);
+ if (name == null) {
+ return "OrmElement";
+ } else {
+ return name;
+ }
} else if (element instanceof Property) {
String name = (String)ormModelNameVisitor.visitPersistentField((Property)element,
null);
if (name == null) {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmModelNameVisitor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmModelNameVisitor.java 2007-06-27
16:05:30 UTC (rev 2193)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmModelNameVisitor.java 2007-06-27
16:06:14 UTC (rev 2194)
@@ -19,6 +19,7 @@
import org.hibernate.mapping.DependantValue;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.SingleTableSubclass;
import org.hibernate.mapping.Table;
/**
@@ -494,6 +495,31 @@
return name.toString();
}
+ public Object visitPersistentClass(SingleTableSubclass clazz, Object argument) {
+
+ StringBuffer name = new StringBuffer();
+// if (((OrmContentProvider) viewer.getContentProvider()).getTip() ==
OrmContentProvider.PACKAGE_CLASS_FIELD_CONTENT_PROVIDER) {
+ name.append(clazz.getEntityName());
+// } else {
+// name.append(clazz.getClassName());
+// }
+
+ //edit tau 24.04.2006
+ Table table = clazz.getTable(); // upd tau 06.06.2005
+ //IDatabaseTable table = HibernateAutoMappingHelper.getPrivateTable(classMapping); //
upd tau 18.04.2005
+ if (table != null) {
+ String tableName = table.getName();
+ if (tableName != null) {
+ //name.append(" (");
+ name.append(POINTER);
+ name.append(tableName);
+ //name.append(")");
+ }
+ }
+
+ return name.toString();
+ }
+
/**
* @see
org.jboss.tools.hibernate.core.IOrmModelVisitor#visitPersistentField(org.jboss.tools.hibernate.core.IPersistentField,
java.lang.Object)
*/
Show replies by date