Module org.eclipse.persistence.core
Class ConstructorQueryMappings
java.lang.Object
org.eclipse.persistence.internal.jpa.jpql.ConstructorQueryMappings
This object scans a
DatabaseQuery and checks if it's a constructor query. If it is one,
then the fully qualified class name and the persistent fields will be available.- Since:
- 2.5
- Version:
- 2.5
-
Method Summary
Modifier and TypeMethodDescriptionReturns the class name used to define the constructor expression.getQuery()Returns theDatabaseQueryfor which its JPQL query was scanned to check if it's constructor query and if so, to gather the information.booleanDetermines whether the JPQL query is a constructor query, i.e.mappings()Returns a non-nullIterableover the ordered list ofDatabaseMappingobjects that represents the parameter arguments defined in the constructor expression.
-
Method Details
-
getClassName
Returns the class name used to define the constructor expression.- Returns:
- Either the fully qualified class name used in the constructor expression or
nullif the query is not a constructor query
-
getQuery
Returns theDatabaseQueryfor which its JPQL query was scanned to check if it's constructor query and if so, to gather the information.- Returns:
- The
DatabaseQuerythat was scanned
-
isConstructorQuery
public boolean isConstructorQuery()Determines whether the JPQL query is a constructor query, i.e. the select expression is a constructor expression.Example:
SELECT new test.example.Employee(e.name, e.id) FROM Employee e- Returns:
trueif theSELECTclause has a single select item and it's a constructor expression;falseotherwise
-
mappings
Returns a non-nullIterableover the ordered list ofDatabaseMappingobjects that represents the parameter arguments defined in the constructor expression.- Returns:
- The list contains the persistent fields that were passed to the constructor
-