Revision: 6147
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6147&view=rev
Author: gerdwagner
Date: 2011-01-27 20:45:53 +0000 (Thu, 27 Jan 2011)
Log Message:
-----------
Improved HQL code completion
Modified Paths:
--------------
trunk/sql12/plugins/hibernate/src/main/java/net/sourceforge/squirrel_sql/plugins/hibernate/completion/HQLCompletionInfoCollection.java
Modified: trunk/sql12/plugins/hibernate/src/main/java/net/sourceforge/squirrel_sql/plugins/hibernate/completion/HQLCompletionInfoCollection.java
===================================================================
--- trunk/sql12/plugins/hibernate/src/main/java/net/sourceforge/squirrel_sql/plugins/hibernate/completion/HQLCompletionInfoCollection.java 2011-01-27 02:30:19 UTC (rev 6146)
+++ trunk/sql12/plugins/hibernate/src/main/java/net/sourceforge/squirrel_sql/plugins/hibernate/completion/HQLCompletionInfoCollection.java 2011-01-27 20:45:53 UTC (rev 6147)
@@ -234,12 +234,21 @@
private MappedClassInfo getMappedClassInfoForNonAliasedToken(CompletionParser cp, boolean matchNameExact)
{
+ MappedClassInfo ret = null;
+
for (MappedClassInfo mappedClassInfo : _mappedClassInfos)
{
- if(mappedClassInfo.matches(cp, matchNameExact, true))
+ if(mappedClassInfo.matches(cp, true, true))
{
+ // An exact match always ends search
return mappedClassInfo;
}
+ else if(false == matchNameExact && mappedClassInfo.matches(cp, false, true))
+ {
+ // We have a non exact match here.
+ // Nonetheless we continue the loop to see if an exact match exists
+ ret = mappedClassInfo;
+ }
if(
cp.getStringToParse().startsWith(mappedClassInfo.getClassName()) ||
@@ -257,7 +266,7 @@
}
}
- return null;
+ return ret;
}
public boolean mayBeClassOrAliasName(String token)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|