Revision: 5581
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=5581&view=rev
Author: gerdwagner
Date: 2010-04-22 21:26:59 +0000 (Thu, 22 Apr 2010)
Log Message:
-----------
Improved display of mapped types in trees
Modified Paths:
--------------
trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/I18NStrings.properties
trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/PersistentCollectionType.java
trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/SingleResult.java
trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/SingleType.java
trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/ViewObjectsUtil.java
Modified: trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/I18NStrings.properties
===================================================================
--- trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/I18NStrings.properties 2010-04-22 20:15:37 UTC (rev 5580)
+++ trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/I18NStrings.properties 2010-04-22 21:26:59 UTC (rev 5581)
@@ -10,8 +10,8 @@
PersistentCollectionResult.uninitialized={0}: uninitialzed collection of type {1}
PersistentCollectionResult.initialized={0}: initialzed collection of type {1}
-PersistentCollectionType.uninitialized=uninitialzed collection of type {0}
-PersistentCollectionType.initialized=initialzed collection of type {0}
+PersistentCollectionType.uninitialized={0}: uninitialzed collection of type {1}
+PersistentCollectionType.initialized={0}: initialzed collection of type {1}
WaitPanel.title=Executing HQL
Modified: trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/PersistentCollectionType.java
===================================================================
--- trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/PersistentCollectionType.java 2010-04-22 20:15:37 UTC (rev 5580)
+++ trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/PersistentCollectionType.java 2010-04-22 21:26:59 UTC (rev 5581)
@@ -14,18 +14,18 @@
private boolean _wasInitalized;
private String _toString;
- public PersistentCollectionType(SingleType singleType, boolean wasInitalized)
+ public PersistentCollectionType(String propertyName, SingleType singleType, boolean wasInitalized)
{
_singleType = singleType;
_wasInitalized = wasInitalized;
if(_wasInitalized)
{
- _toString = s_stringMgr.getString("PersistentCollectionType.initialized", _singleType.getMappedClassInfo().getClassName());
+ _toString = s_stringMgr.getString("PersistentCollectionType.initialized", propertyName, _singleType.getMappedClassInfo().getClassName());
}
else
{
- _toString = s_stringMgr.getString("PersistentCollectionType.uninitialized", _singleType.getMappedClassInfo().getClassName());
+ _toString = s_stringMgr.getString("PersistentCollectionType.uninitialized", propertyName, _singleType.getMappedClassInfo().getClassName());
}
}
Modified: trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/SingleResult.java
===================================================================
--- trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/SingleResult.java 2010-04-22 20:15:37 UTC (rev 5580)
+++ trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/SingleResult.java 2010-04-22 21:26:59 UTC (rev 5581)
@@ -11,12 +11,24 @@
public SingleResult(Object object, MappedClassInfo mappedClassInfo)
{
+ this(null, object, mappedClassInfo);
+ }
+
+ public SingleResult(String propertyNameInParent, Object object, MappedClassInfo mappedClassInfo)
+ {
_object = object;
_mappedClassInfo = mappedClassInfo;
- _toString = _mappedClassInfo.getClassName();
+ _toString = "";
+ if(null != propertyNameInParent)
+ {
+ _toString = propertyNameInParent + ": ";
+ }
+
+ _toString += _mappedClassInfo.getClassName();
+
if (null == _object)
{
_toString += " <null>";
Modified: trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/SingleType.java
===================================================================
--- trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/SingleType.java 2010-04-22 20:15:37 UTC (rev 5580)
+++ trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/SingleType.java 2010-04-22 21:26:59 UTC (rev 5581)
@@ -17,17 +17,33 @@
private Class _persistenCollectionClass;
private ArrayList<SingleResult> _results = new ArrayList<SingleResult>();
private ArrayList<IType> _kidTypes;
+ private String _toString;
public SingleType(MappedClassInfo mappedClassInfo, ArrayList<MappedClassInfo> allMappedClassInfos, Class persistenCollectionClass, List objects)
{
+ this(null, mappedClassInfo, allMappedClassInfos, persistenCollectionClass, objects);
+ }
+
+ public SingleType(String propertyName, MappedClassInfo mappedClassInfo, ArrayList<MappedClassInfo> allMappedClassInfos, Class persistenCollectionClass, List objects)
+ {
_mappedClassInfo = mappedClassInfo;
_allMappedClassInfos = allMappedClassInfos;
_persistenCollectionClass = persistenCollectionClass;
for (Object object : objects)
{
- _results.add(new SingleResult(object, mappedClassInfo));
+ _results.add(new SingleResult(propertyName, object, mappedClassInfo));
}
+
+ if (null == propertyName)
+ {
+ _toString = _mappedClassInfo.getClassName();
+ }
+ else
+ {
+ _toString = propertyName + ": " + _mappedClassInfo.getClassName();
+ }
+
}
@@ -94,10 +110,10 @@
if(null != mci)
{
- SingleType singleType = new SingleType(mci, _allMappedClassInfos, _persistenCollectionClass, objects);
+ SingleType singleType = new SingleType(propertyName, mci, _allMappedClassInfos, _persistenCollectionClass, objects);
if(persistentCollection)
{
- _kidTypes.add(new PersistentCollectionType(singleType, persistentCollectionInitialized));
+ _kidTypes.add(new PersistentCollectionType(propertyName, singleType, persistentCollectionInitialized));
}
else
{
@@ -141,7 +157,7 @@
@Override
public String toString()
{
- return _mappedClassInfo.getClassName();
+ return _toString;
}
Modified: trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/ViewObjectsUtil.java
===================================================================
--- trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/ViewObjectsUtil.java 2010-04-22 20:15:37 UTC (rev 5580)
+++ trunk/sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/viewobjects/ViewObjectsUtil.java 2010-04-22 21:26:59 UTC (rev 5581)
@@ -52,7 +52,7 @@
}
else if (null != findMappedClassInfo(hpr.getTypeName(), allMappedClassInfos, true))
{
- SingleResult buf = new SingleResult(hpr.getValue(), findMappedClassInfo(hpr.getTypeName(), allMappedClassInfos, false));
+ SingleResult buf = new SingleResult(propertyName, hpr.getValue(), findMappedClassInfo(hpr.getTypeName(), allMappedClassInfos, false));
parent.add(new DefaultMutableTreeNode(buf));
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|