Class ConstructorQueryMappings
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.jpql.ConstructorQueryMappings
-
public final class ConstructorQueryMappings extends Object
This object scans aDatabaseQuery
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
- Author:
- Pascal Filion
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getClassName()
Returns the class name used to define the constructor expression.DatabaseQuery
getQuery()
Returns theDatabaseQuery
for which its JPQL query was scanned to check if it's constructor query and if so, to gather the information.boolean
isConstructorQuery()
Determines whether the JPQL query is a constructor query, i.e.Iterable<DatabaseMapping>
mappings()
Returns a non-null
Iterable
over the ordered list ofDatabaseMapping
objects that represents the parameter arguments defined in the constructor expression.
-
-
-
Method Detail
-
getClassName
public 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
null
if the query is not a constructor query
-
getQuery
public DatabaseQuery getQuery()
Returns theDatabaseQuery
for which its JPQL query was scanned to check if it's constructor query and if so, to gather the information.- Returns:
- The
DatabaseQuery
that 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:
true
if theSELECT
clause has a single select item and it's a constructor expression;false
otherwise
-
mappings
public Iterable<DatabaseMapping> mappings()
Returns a non-null
Iterable
over the ordered list ofDatabaseMapping
objects that represents the parameter arguments defined in the constructor expression.- Returns:
- The list contains the persistent fields that were passed to the constructor
-
-