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 voidaccept(StateObjectVisitor visitor)Visits thisStateObjectby the givenvisitor.IEntitygetEntity()Returns the actual external form representing theIEntity.AbstractSchemaNamegetExpression()Returns the actual parsed object if thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.java.lang.StringgetText()Returns the name of the abstract schema, which is the name of the entity.booleanisEntityResolved()Determines whether theIEntityhas been resolved.voidresolveEntity()Resolves the abstract schema name and retrieve the associatedIEntity.voidsetEntity(IEntity entity)Sets the actualIEntityand updates the abstract schema name.voidsetExpression(AbstractSchemaName expression)Keeps a reference of theparsed objectobject, which should only be done when this object is instantiated during the conversion of a parsed JPQL query intoStateObjects.voidsetText(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 benullentity- TheIEntityitself- 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 benullentityName- The name of the entity- Throws:
java.lang.NullPointerException- The given parent cannot benull
-
-
Method Detail
-
accept
public void accept(StateObjectVisitor visitor)
Visits thisStateObjectby the givenvisitor.- Parameters:
visitor- Thevisitorto visit this object
-
getEntity
public IEntity getEntity()
Returns the actual external form representing theIEntity.- Returns:
- The actual
IEntityornullif no entity exists with the entity name
-
getExpression
public AbstractSchemaName getExpression()
Returns the actual parsed object if thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.- Specified by:
getExpressionin interfaceStateObject- Overrides:
getExpressionin classAbstractStateObject- Returns:
- The parsed object when a JPQL query is parsed and converted into a
StateObjectornullwhen 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:
getTextin classSimpleStateObject- Returns:
- The name of the abstract schema, which is the name of the entity
-
isEntityResolved
public boolean isEntityResolved()
Determines whether theIEntityhas been resolved.- Returns:
trueif an entity exists with the abstract schema name in the managed types provider;falseotherwise
-
resolveEntity
public void resolveEntity()
Resolves the abstract schema name and retrieve the associatedIEntity.
-
setEntity
public void setEntity(IEntity entity)
Sets the actualIEntityand updates the abstract schema name.- Parameters:
entity- The newIEntity
-
setExpression
public void setExpression(AbstractSchemaName expression)
Keeps a reference of theparsed objectobject, which should only be done when this object is instantiated during the conversion of a parsed JPQL query intoStateObjects.- Parameters:
expression- Theparsed objectrepresenting 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:
setTextin classSimpleStateObject- Parameters:
abstractSchemaName- The name of the abstract schema, which is the name of the entity
-
-