SELECT clause a constructor may be used in the SELECT
list to return one or more Java instances. The specified class is not required to be an entity or
to be mapped to the database. The constructor name must be fully qualified.
BNF: constructor_expression ::= NEW constructor_name(constructor_item {, constructor_item}*)
ConstructorExpression
| Modifier and Type | Field and Description |
|---|---|
| public static final String | CLASS_NAME_PROPERTY
Notifies the class name property has changed. |
| private String | className
The fully qualified class name of the Java object to instantiate. |
| public static final String | CONSTRUCTOR_ITEMS_LIST
Notify the list of |
| private IType | type
The actual type that was resolved based on the class name. |
| Access | Constructor and Description |
|---|---|
| public | ConstructorExpressionStateObject(StateObject
The parent of this state object, which cannot be parent)nullCreates a new |
| public | ConstructorExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, Class<?> nullThe fully qualified name of the Java class to instantiate type)Creates a new |
| public | ConstructorExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, Class<?> nullThe Java class to instantiate type, List<? extends StateObject> The list of arguments constructorItems)Creates a new |
| public | ConstructorExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, Class<?> nullThe Java class to instantiate type, String The portion of the JPQL query that represents the constructor's arguments jpqlFragment)Creates a new |
| public | ConstructorExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, String nullThe fully qualified name of the Java class to instantiate className)Creates a new |
| public | ConstructorExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, String nullThe fully qualified name of the Java class to instantiate className, List<? extends StateObject> The list of arguments constructorItems)Creates a new |
| public | ConstructorExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, String nullThe fully qualified name of the Java class to instantiate className, String The portion of the JPQL query that represents the constructor's arguments jpqlFragment)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(StateObjectVisitor
The visitor)visitor to visit this objectImplements org. StateObject by the given visitor.
|
| public String | Returns: The fully qualified class name or an empty string if it is not definedReturns the fully qualified class name that will be used to retrieve the constructor. |
| public ConstructorExpression | getExpression()
Overrides org. Implements org. StateObject representation of the JPQL query
was created by parsing an existing JPQL query.
|
| public IType | |
| public boolean | isEquivalent(StateObject
The stateObject)StateObject to compare its content to this oneOverrides org. Implements org. StateObject is equivalent to this one, i.e. the
information of both StateObject is the same.
|
| protected String | listName()
Implements abstract org. |
| public void | |
| protected IType | Returns: TheIType with the fully qualified class nameResolves the actual |
| public void | setClassName(CharSequence
The fully qualified class name className)Sets the fully qualified class name that will be used to retrieve the constructor. |
| public void | setClassName(Class<?>
The type used to retrieve its fully qualified class name type)Sets the fully qualified class name that will be used to retrieve the constructor. |
| protected void | setClassNameInternally(CharSequence
The fully qualified class name className)Sets the fully qualified class name that will be used to retrieve the constructor. |
| public void | setExpression(ConstructorExpression
The expression)parsed object representing a NEW
expressionKeeps a reference of the |
| public void | |
| protected void | toTextInternal(Appendable
The writer used to print out the string representation writer)Implements abstract org. StateObject, which should not be used to
define a true string representation of a JPQL query but should be used for
debugging purposes.
|
| CLASS_NAME_PROPERTY | back to summary |
|---|---|
| public static final String CLASS_NAME_PROPERTY Notifies the class name property has changed. | |
| className | back to summary |
|---|---|
| private String className The fully qualified class name of the Java object to instantiate. | |
| CONSTRUCTOR_ITEMS_LIST | back to summary |
|---|---|
| public static final String CONSTRUCTOR_ITEMS_LIST Notify the list of | |
| type | back to summary |
|---|---|
| private IType type The actual type that was resolved based on the class name. | |
| ConstructorExpressionStateObject | back to summary |
|---|---|
| public ConstructorExpressionStateObject(StateObject parent) Creates a new
| |
| ConstructorExpressionStateObject | back to summary |
|---|---|
| public ConstructorExpressionStateObject(StateObject parent, Class<?> type) Creates a new
| |
| ConstructorExpressionStateObject | back to summary |
|---|---|
| public ConstructorExpressionStateObject(StateObject parent, Class<?> type, List<? extends StateObject> constructorItems) Creates a new
| |
| ConstructorExpressionStateObject | back to summary |
|---|---|
| public ConstructorExpressionStateObject(StateObject parent, Class<?> type, String jpqlFragment) Creates a new
| |
| ConstructorExpressionStateObject | back to summary |
|---|---|
| public ConstructorExpressionStateObject(StateObject parent, String className) Creates a new
| |
| ConstructorExpressionStateObject | back to summary |
|---|---|
| public ConstructorExpressionStateObject(StateObject parent, String className, List<? extends StateObject> constructorItems) Creates a new
| |
| ConstructorExpressionStateObject | back to summary |
|---|---|
| public ConstructorExpressionStateObject(StateObject parent, String className, String jpqlFragment) Creates a new
| |
| accept | back to summary |
|---|---|
| public void accept(StateObjectVisitor visitor) Implements org. Doc from org. Visits this
| |
| getClassName | back to summary |
|---|---|
| public String getClassName() Returns the fully qualified class name that will be used to retrieve the constructor.
| |
| getExpression | back to summary |
|---|---|
| public ConstructorExpression getExpression() Overrides org. Implements org. Doc from org. Returns the actual parsed object if this
| |
| getType | back to summary |
|---|---|
| public IType getType() Returns the actual | |
| isEquivalent | back to summary |
|---|---|
| public boolean isEquivalent(StateObject stateObject) Overrides org. Implements org. Doc from org. Determines whether the given
| |
| listName | back to summary |
|---|---|
| protected String listName() Implements abstract org. Doc from org. Returns the name that is uniquely identifying the list. | |
| parse | back to summary |
|---|---|
| public void parse(String jpqlFragment) Parses the given JPQL fragment, which represents the constructor's arguments.
| |
| resolveType | back to summary |
|---|---|
| protected IType resolveType() Resolves the actual | |
| setClassName | back to summary |
|---|---|
| public void setClassName(CharSequence className) Sets the fully qualified class name that will be used to retrieve the constructor.
| |
| setClassName | back to summary |
|---|---|
| public void setClassName(Class<?> type) Sets the fully qualified class name that will be used to retrieve the constructor.
| |
| setClassNameInternally | back to summary |
|---|---|
| protected void setClassNameInternally(CharSequence className) Sets the fully qualified class name that will be used to retrieve the constructor.
| |
| setExpression | back to summary |
|---|---|
| public void setExpression(ConstructorExpression expression) Keeps a reference of the
| |
| setType | back to summary |
|---|---|
| public void setType(IType type) Sets the actual | |
| toTextInternal | back to summary |
|---|---|
| protected void toTextInternal(Appendable writer) throws IOException Implements abstract org. Doc from org. Prints out a string representation of this
| |