Class ConstructorQueryMappings
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.jpql.ConstructorQueryMappings
-
public final class ConstructorQueryMappings extends java.lang.ObjectThis object scans aDatabaseQueryand 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
- Author:
- Pascal Filion
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetClassName()Returns the class name used to define the constructor expression.DatabaseQuerygetQuery()Returns theDatabaseQueryfor which its JPQL query was scanned to check if it's constructor query and if so, to gather the information.booleanisConstructorQuery()Determines whether the JPQL query is a constructor query, i.e.java.lang.Iterable<DatabaseMapping>mappings()Returns a non-nullIterableover the ordered list ofDatabaseMappingobjects that represents the parameter arguments defined in the constructor expression.
-
-
-
Method Detail
-
getClassName
public java.lang.String 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
public DatabaseQuery 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
public java.lang.Iterable<DatabaseMapping> 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
-
-