Class AbstractSchemaNameStateObject
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.SimpleStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSchemaNameStateObject
-
- All Implemented Interfaces:
StateObject
public class AbstractSchemaNameStateObject extends SimpleStateObject
An abstract schema name designates the abstract schema type over which the query ranges.- Version:
- 2.4
- See Also:
AbstractSchemaName
- Author:
- Pascal Filion
- Since:
- 2.4
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.SimpleStateObject
TEXT_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description AbstractSchemaNameStateObject(StateObject parent)
Creates a newAbstractSchemaNameStateObject
.AbstractSchemaNameStateObject(StateObject parent, java.lang.String entityName)
Creates a newAbstractSchemaNameStateObject
.AbstractSchemaNameStateObject(StateObject parent, IEntity entity)
Creates a newAbstractSchemaNameStateObject
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(StateObjectVisitor visitor)
Visits thisStateObject
by the givenvisitor
.IEntity
getEntity()
Returns the actual external form representing theIEntity
.AbstractSchemaName
getExpression()
Returns the actual parsed object if thisStateObject
representation of the JPQL query was created by parsing an existing JPQL query.java.lang.String
getText()
Returns the name of the abstract schema, which is the name of the entity.boolean
isEntityResolved()
Determines whether theIEntity
has been resolved.void
resolveEntity()
Resolves the abstract schema name and retrieve the associatedIEntity
.void
setEntity(IEntity entity)
Sets the actualIEntity
and updates the abstract schema name.void
setExpression(AbstractSchemaName expression)
Keeps a reference of theparsed object
object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query intoStateObjects
.void
setText(java.lang.String abstractSchemaName)
Sets the name of the abstract schema, which is the name of the entity.-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.SimpleStateObject
hasText, isEquivalent, setTextInternally, toTextInternal
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
acceptUnknownVisitor, acceptUnknownVisitor, addChildren, addProblems, addPropertyChangeListener, areEquivalent, buildProblem, buildProblem, buildStateObject, buildStateObjects, checkParent, children, decorate, equals, findIdentificationVariable, firePropertyChanged, getChangeSupport, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, initialize, isDecorated, parent, parent, parent, removePropertyChangeListener, setExpression, setParent, toString, toString, toStringInternal, toStringItems, toText
-
-
-
-
Constructor Detail
-
AbstractSchemaNameStateObject
public AbstractSchemaNameStateObject(StateObject parent)
Creates a newAbstractSchemaNameStateObject
.- Parameters:
parent
- The parent of this state object, which cannot benull
- Throws:
java.lang.NullPointerException
- The given parent cannot benull
-
AbstractSchemaNameStateObject
public AbstractSchemaNameStateObject(StateObject parent, IEntity entity)
Creates a newAbstractSchemaNameStateObject
.- Parameters:
parent
- The parent of this state object, which cannot benull
entity
- TheIEntity
itself- Throws:
java.lang.NullPointerException
- The given parent cannot benull
-
AbstractSchemaNameStateObject
public AbstractSchemaNameStateObject(StateObject parent, java.lang.String entityName)
Creates a newAbstractSchemaNameStateObject
.- Parameters:
parent
- The parent of this state object, which cannot benull
entityName
- The name of the entity- Throws:
java.lang.NullPointerException
- The given parent cannot benull
-
-
Method Detail
-
accept
public void accept(StateObjectVisitor visitor)
Visits thisStateObject
by the givenvisitor
.- Parameters:
visitor
- Thevisitor
to visit this object
-
getEntity
public IEntity getEntity()
Returns the actual external form representing theIEntity
.- Returns:
- The actual
IEntity
ornull
if no entity exists with the entity name
-
getExpression
public AbstractSchemaName getExpression()
Returns the actual parsed object if thisStateObject
representation of the JPQL query was created by parsing an existing JPQL query.- Specified by:
getExpression
in interfaceStateObject
- Overrides:
getExpression
in classAbstractStateObject
- Returns:
- The parsed object when a JPQL query is parsed and converted into a
StateObject
ornull
when the JPQL query is manually created (i.e. not from a string)
-
getText
public java.lang.String getText()
Returns the name of the abstract schema, which is the name of the entity.- Overrides:
getText
in classSimpleStateObject
- Returns:
- The name of the abstract schema, which is the name of the entity
-
isEntityResolved
public boolean isEntityResolved()
Determines whether theIEntity
has been resolved.- Returns:
true
if an entity exists with the abstract schema name in the managed types provider;false
otherwise
-
resolveEntity
public void resolveEntity()
Resolves the abstract schema name and retrieve the associatedIEntity
.
-
setEntity
public void setEntity(IEntity entity)
Sets the actualIEntity
and updates the abstract schema name.- Parameters:
entity
- The newIEntity
-
setExpression
public void setExpression(AbstractSchemaName expression)
Keeps a reference of theparsed object
object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query intoStateObjects
.- Parameters:
expression
- Theparsed object
representing an abstract schema name (entity name)
-
setText
public void setText(java.lang.String abstractSchemaName)
Sets the name of the abstract schema, which is the name of the entity.- Overrides:
setText
in classSimpleStateObject
- Parameters:
abstractSchemaName
- The name of the abstract schema, which is the name of the entity
-
-