Author: stliu
Date: 2012-07-22 09:08:20 -0400 (Sun, 22 Jul 2012)
New Revision: 21041
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/NamedSQLQuerySecondPass.java
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/dialect/Dialect.java
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/NamedSQLQueryDefinition.java
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/ResultSetMappingDefinition.java
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryNonScalarReturn.java
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryRootReturn.java
Log:
JBPAPP-6571 HHH-2536/HHH-2225 NPE in SQLQuery when Entity has @Formula attribute
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/NamedSQLQuerySecondPass.java
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/NamedSQLQuerySecondPass.java 2012-07-20
07:59:52 UTC (rev 21040)
+++
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/NamedSQLQuerySecondPass.java 2012-07-22
13:08:20 UTC (rev 21041)
@@ -69,7 +69,7 @@
Attribute cmAtt = queryElem.attribute( "comment" );
String comment = cmAtt == null ? null : cmAtt.getValue();
- java.util.List synchronizedTables = new ArrayList();
+ java.util.List<String> synchronizedTables = new ArrayList<String>();
Iterator tables = queryElem.elementIterator( "synchronize" );
while ( tables.hasNext() ) {
synchronizedTables.add( ( (Element) tables.next() ).attributeValue( "table"
) );
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/dialect/Dialect.java
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/dialect/Dialect.java 2012-07-20
07:59:52 UTC (rev 21040)
+++
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/dialect/Dialect.java 2012-07-22
13:08:20 UTC (rev 21041)
@@ -93,7 +93,7 @@
// build the map of standard ANSI SQL aggregation functions ~~~~~~~~~~~~~~~
- private static final Map STANDARD_AGGREGATE_FUNCTIONS = new HashMap();
+ private static final Map<String,SQLFunction> STANDARD_AGGREGATE_FUNCTIONS = new
HashMap<String,SQLFunction>();
static {
STANDARD_AGGREGATE_FUNCTIONS.put( "count", new
StandardSQLFunction("count") {
public Type getReturnType(Type columnType, Mapping mapping) {
@@ -165,7 +165,7 @@
private final TypeNames hibernateTypeNames = new TypeNames();
private final Properties properties = new Properties();
- private final Map sqlFunctions = new HashMap();
+ private final Map<String, SQLFunction> sqlFunctions = new
HashMap<String,SQLFunction>();
private final Set sqlKeywords = new HashSet();
@@ -435,7 +435,7 @@
*
* @return The map of registered functions.
*/
- public final Map getFunctions() {
+ public final Map<String,SQLFunction> getFunctions() {
return sqlFunctions;
}
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/NamedSQLQueryDefinition.java
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/NamedSQLQueryDefinition.java 2012-07-20
07:59:52 UTC (rev 21040)
+++
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/NamedSQLQueryDefinition.java 2012-07-22
13:08:20 UTC (rev 21041)
@@ -40,7 +40,7 @@
public class NamedSQLQueryDefinition extends NamedQueryDefinition {
private NativeSQLQueryReturn[] queryReturns;
- private final List querySpaces;
+ private final List<String> querySpaces;
private final boolean callable;
private String resultSetRef;
@@ -66,7 +66,7 @@
public NamedSQLQueryDefinition(
String query,
NativeSQLQueryReturn[] queryReturns,
- List querySpaces,
+ List<String> querySpaces,
boolean cacheable,
String cacheRegion,
Integer timeout,
@@ -115,7 +115,7 @@
public NamedSQLQueryDefinition(
String query,
String resultSetRef,
- List querySpaces,
+ List<String> querySpaces,
boolean cacheable,
String cacheRegion,
Integer timeout,
@@ -165,7 +165,7 @@
public NamedSQLQueryDefinition(
String query,
String resultSetRef,
- List querySpaces,
+ List<String> querySpaces,
boolean cacheable,
String cacheRegion,
Integer timeout,
@@ -194,7 +194,7 @@
return queryReturns;
}
- public List getQuerySpaces() {
+ public List<String> getQuerySpaces() {
return querySpaces;
}
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/ResultSetMappingDefinition.java
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/ResultSetMappingDefinition.java 2012-07-20
07:59:52 UTC (rev 21040)
+++
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/ResultSetMappingDefinition.java 2012-07-22
13:08:20 UTC (rev 21041)
@@ -38,7 +38,7 @@
public class ResultSetMappingDefinition implements Serializable {
private final String name;
- private final List /*NativeSQLQueryReturn*/ queryReturns = new ArrayList();
+ private final List<NativeSQLQueryReturn> queryReturns = new
ArrayList<NativeSQLQueryReturn>();
public ResultSetMappingDefinition(String name) {
this.name = name;
@@ -52,18 +52,8 @@
queryReturns.add( queryReturn );
}
-// We could also keep these if needed for binary compatibility with annotations,
provided
-// it only uses the addXXX() methods...
-// public void addEntityQueryReturn(NativeSQLQueryNonScalarReturn entityQueryReturn) {
-// entityQueryReturns.add(entityQueryReturn);
-// }
-//
-// public void addScalarQueryReturn(NativeSQLQueryScalarReturn scalarQueryReturn) {
-// scalarQueryReturns.add(scalarQueryReturn);
-// }
-
public NativeSQLQueryReturn[] getQueryReturns() {
- return ( NativeSQLQueryReturn[] ) queryReturns.toArray( new NativeSQLQueryReturn[0] );
+ return queryReturns.toArray( new NativeSQLQueryReturn[queryReturns.size()] );
}
}
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryNonScalarReturn.java
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryNonScalarReturn.java 2012-07-20
07:59:52 UTC (rev 21040)
+++
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryNonScalarReturn.java 2012-07-22
13:08:20 UTC (rev 21041)
@@ -41,7 +41,7 @@
public abstract class NativeSQLQueryNonScalarReturn implements NativeSQLQueryReturn,
Serializable {
private final String alias;
private final LockMode lockMode;
- private final Map propertyResults = new HashMap();
+ private final Map<String, String[]> propertyResults = new HashMap<String,
String[]>();
private final int hashCode;
/**
@@ -51,7 +51,7 @@
* @param propertyResults Any user-supplied column->property mappings
* @param lockMode The lock mode to apply to the return.
*/
- protected NativeSQLQueryNonScalarReturn(String alias, Map propertyResults, LockMode
lockMode) {
+ protected NativeSQLQueryNonScalarReturn(String alias, Map<String, String[]>
propertyResults, LockMode lockMode) {
this.alias = alias;
if ( alias == null ) {
throw new HibernateException("alias must be specified");
@@ -87,7 +87,7 @@
*
* @return The property mappings.
*/
- public Map getPropertyResultsMap() {
+ public Map<String, String[]> getPropertyResultsMap() {
return Collections.unmodifiableMap( propertyResults );
}
public int hashCode() {
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryRootReturn.java
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryRootReturn.java 2012-07-20
07:59:52 UTC (rev 21040)
+++
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/engine/query/sql/NativeSQLQueryRootReturn.java 2012-07-22
13:08:20 UTC (rev 21041)
@@ -58,7 +58,7 @@
* @param propertyResults Any user-supplied column->property mappings
* @param lockMode The lock mode to apply
*/
- public NativeSQLQueryRootReturn(String alias, String entityName, Map propertyResults,
LockMode lockMode) {
+ public NativeSQLQueryRootReturn(String alias, String entityName, Map<String,
String[]> propertyResults, LockMode lockMode) {
super( alias, propertyResults, lockMode );
this.returnEntityName = entityName;
this.hashCode = determineHashCode();