Author: vyemialyanchyk
Date: 2009-12-16 09:54:14 -0500 (Wed, 16 Dec 2009)
New Revision: 19307
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/BaseElement.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmShape.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5341 - update fix
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/BaseElement.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/BaseElement.java 2009-12-16
14:51:40 UTC (rev 19306)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/BaseElement.java 2009-12-16
14:54:14 UTC (rev 19307)
@@ -155,7 +155,7 @@
}
public Object getEditableValue() {
- return this;
+ return toString();
}
/**
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java 2009-12-16
14:51:40 UTC (rev 19306)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java 2009-12-16
14:54:14 UTC (rev 19307)
@@ -286,9 +286,9 @@
}
} else if (PROPERTY_CLASS_FIELD_TYPE.equals(propertyId)) {
if (source.getOrmElement() instanceof Property) {
- res = ((Property)(source.getOrmElement())).getType();
+ res = ((Property)(source.getOrmElement())).getType().toString();
} else if (target.getOrmElement() instanceof Property) {
- res = ((Property)(target.getOrmElement())).getType();
+ res = ((Property)(target.getOrmElement())).getType().toString();
}
} else if (PROPERTY_TABLE_FIELD_TYPE.equals(propertyId)) {
if (source.getOrmElement() instanceof Column) {
@@ -298,9 +298,9 @@
}
} else if (PROPERTY_ASSOCIATION_TYPE.equals(propertyId)) {
if (source.getOrmElement() instanceof Property) {
- res = ((Property)(source.getOrmElement())).getValue();
+ res = ((Property)(source.getOrmElement())).getValue().toString();
} else if (target.getOrmElement() instanceof Property) {
- res = ((Property)(target.getOrmElement())).getValue();
+ res = ((Property)(target.getOrmElement())).getValue().toString();
}
if (res instanceof OneToOne) {
res = "OneToOne"; //$NON-NLS-1$
@@ -315,7 +315,7 @@
}
} else if (PROPERTY_SOURCE_CLASS_FIELD_TYPE.equals(propertyId)) {
if (source.getOrmElement() instanceof Property) {
- res = ((Property)(source.getOrmElement())).getType();
+ res = ((Property)(source.getOrmElement())).getType().toString();
}
} else if (PROPERTY_SOURCE_TABLE_FIELD.equals(propertyId)) {
if (source.getOrmElement() instanceof Column) {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java 2009-12-16
14:51:40 UTC (rev 19306)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java 2009-12-16
14:54:14 UTC (rev 19307)
@@ -1022,13 +1022,13 @@
if (PROPERTY_NAME.equals(propertyId)) {
res = getDiagramName();
} else if (PROPERTY_WIDTH.equals(propertyId)) {
- res = width;
+ res = Integer.valueOf(width).toString();
} else if (PROPERTY_HEIGHT.equals(propertyId)) {
- res = height;
+ res = Integer.valueOf(height).toString();
} else if (PROPERTY_ZOOM.equals(propertyId)) {
- res = zoom;
+ res = Double.valueOf(zoom).toString();
} else if (PROPERTY_ITEMS.equals(propertyId)) {
- res = elements.size();
+ res = Integer.valueOf(elements.size()).toString();
} else if (PROPERTY_ENTITIES.equals(propertyId)) {
int nEntities = 0;
Iterator<OrmShape> it = elements.values().iterator();
@@ -1039,7 +1039,7 @@
nEntities++;
}
}
- res = nEntities;
+ res = Integer.valueOf(nEntities).toString();
} else if (PROPERTY_TABLES.equals(propertyId)) {
int nTables = 0;
Iterator<OrmShape> it = elements.values().iterator();
@@ -1050,7 +1050,7 @@
nTables++;
}
}
- res = nTables;
+ res = Integer.valueOf(nTables).toString();
} else if (PROPERTY_INVISIBLE.equals(propertyId)) {
int nInvisible = 0;
Iterator<OrmShape> it = elements.values().iterator();
@@ -1060,7 +1060,7 @@
nInvisible++;
}
}
- res = nInvisible;
+ res = Integer.valueOf(nInvisible).toString();
}
if (res == null) {
res = super.getPropertyValue(propertyId);
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmShape.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmShape.java 2009-12-16
14:51:40 UTC (rev 19306)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmShape.java 2009-12-16
14:54:14 UTC (rev 19307)
@@ -473,39 +473,41 @@
}
if (rootClass != null) {
if (ENTITY_isAbstract.equals(propertyId)) {
- res = rootClass.isAbstract();
+ if (rootClass.isAbstract() != null) {
+ res = rootClass.isAbstract().toString();
+ }
} else if (ENTITY_isCustomDeleteCallable.equals(propertyId)) {
- res = rootClass.isCustomDeleteCallable();
+ res = Boolean.valueOf(rootClass.isCustomDeleteCallable()).toString();
} else if (ENTITY_isCustomInsertCallable.equals(propertyId)) {
- res = rootClass.isCustomInsertCallable();
+ res = Boolean.valueOf(rootClass.isCustomInsertCallable()).toString();
} else if (ENTITY_isCustomUpdateCallable.equals(propertyId)) {
- res = rootClass.isCustomUpdateCallable();
+ res = Boolean.valueOf(rootClass.isCustomUpdateCallable()).toString();
} else if (ENTITY_isDiscriminatorInsertable.equals(propertyId)) {
- res = rootClass.isDiscriminatorInsertable();
+ res = Boolean.valueOf(rootClass.isDiscriminatorInsertable()).toString();
} else if (ENTITY_isDiscriminatorValueNotNull.equals(propertyId)) {
- res = rootClass.isDiscriminatorValueNotNull();
+ res = Boolean.valueOf(rootClass.isDiscriminatorValueNotNull()).toString();
} else if (ENTITY_isDiscriminatorValueNull.equals(propertyId)) {
- res = rootClass.isDiscriminatorValueNull();
+ res = Boolean.valueOf(rootClass.isDiscriminatorValueNull()).toString();
} else if (ENTITY_isExplicitPolymorphism.equals(propertyId)) {
- res = rootClass.isExplicitPolymorphism();
+ res = Boolean.valueOf(rootClass.isExplicitPolymorphism()).toString();
} else if (ENTITY_isForceDiscriminator.equals(propertyId)) {
- res = rootClass.isForceDiscriminator();
+ res = Boolean.valueOf(rootClass.isForceDiscriminator()).toString();
} else if (ENTITY_isInherited.equals(propertyId)) {
- res = rootClass.isInherited();
+ res = Boolean.valueOf(rootClass.isInherited()).toString();
} else if (ENTITY_isJoinedSubclass.equals(propertyId)) {
- res = rootClass.isJoinedSubclass();
+ res = Boolean.valueOf(rootClass.isJoinedSubclass()).toString();
} else if (ENTITY_isLazy.equals(propertyId)) {
- res = rootClass.isLazy();
+ res = Boolean.valueOf(rootClass.isLazy()).toString();
} else if (ENTITY_isLazyPropertiesCacheable.equals(propertyId)) {
- res = rootClass.isLazyPropertiesCacheable();
+ res = Boolean.valueOf(rootClass.isLazyPropertiesCacheable()).toString();
} else if (ENTITY_isMutable.equals(propertyId)) {
- res = rootClass.isMutable();
+ res = Boolean.valueOf(rootClass.isMutable()).toString();
} else if (ENTITY_isPolymorphic.equals(propertyId)) {
- res = rootClass.isPolymorphic();
+ res = Boolean.valueOf(rootClass.isPolymorphic()).toString();
} else if (ENTITY_isVersioned.equals(propertyId)) {
- res = rootClass.isVersioned();
+ res = Boolean.valueOf(rootClass.isVersioned()).toString();
} else if (ENTITY_batchSize.equals(propertyId)) {
- res = rootClass.getBatchSize();
+ res = Integer.valueOf(rootClass.getBatchSize()).toString();
} else if (ENTITY_cacheConcurrencyStrategy.equals(propertyId)) {
res = rootClass.getCacheConcurrencyStrategy();
} else if (ENTITY_className.equals(propertyId)) {
@@ -525,9 +527,11 @@
} else if (ENTITY_nodeName.equals(propertyId)) {
res = rootClass.getNodeName();
} else if (ENTITY_optimisticLockMode.equals(propertyId)) {
- res = rootClass.getOptimisticLockMode();
+ res = Integer.valueOf(rootClass.getOptimisticLockMode()).toString();
} else if (ENTITY_table.equals(propertyId)) {
- res = rootClass.getTable();
+ if (rootClass.getTable() != null) {
+ res = rootClass.getTable().getName();
+ }
} else if (ENTITY_temporaryIdTableDDL.equals(propertyId)) {
res = rootClass.getTemporaryIdTableDDL();
} else if (ENTITY_temporaryIdTableName.equals(propertyId)) {
@@ -544,7 +548,9 @@
} else if (TABLE_name.equals(propertyId)) {
res = table.getName();
} else if (TABLE_primaryKey.equals(propertyId)) {
- res = table.getPrimaryKey();
+ if (table.getPrimaryKey() != null) {
+ res = table.getPrimaryKey().getName();
+ }
} else if (TABLE_rowId.equals(propertyId)) {
res = table.getRowId();
} else if (TABLE_schema.equals(propertyId)) {
@@ -552,13 +558,13 @@
} else if (TABLE_subselect.equals(propertyId)) {
res = table.getSubselect();
} else if (TABLE_hasDenormalizedTables.equals(propertyId)) {
- res = table.hasDenormalizedTables();
+ res = Boolean.valueOf(table.hasDenormalizedTables()).toString();
} else if (TABLE_isAbstract.equals(propertyId)) {
- res = table.isAbstract();
+ res = Boolean.valueOf(table.isAbstract()).toString();
} else if (TABLE_isAbstractUnionTable.equals(propertyId)) {
- res = table.isAbstractUnionTable();
+ res = Boolean.valueOf(table.isAbstractUnionTable()).toString();
} else if (TABLE_isPhysicalTable.equals(propertyId)) {
- res = table.isPhysicalTable();
+ res = Boolean.valueOf(table.isPhysicalTable()).toString();
}
}
if (res == null) {