public class SessionFactoryHelper
extends java.lang.Object
SessionFactoryImplementor
during translation of an HQL query.Constructor and Description |
---|
SessionFactoryHelper(SessionFactoryImplementor sfi)
Construct a new SessionFactoryHelper instance.
|
Modifier and Type | Method and Description |
---|---|
JoinSequence |
createCollectionJoinSequence(QueryableCollection collPersister,
java.lang.String collectionName)
Create a join sequence rooted at the given collection.
|
JoinSequence |
createJoinSequence()
Generate an empty join sequence instance.
|
JoinSequence |
createJoinSequence(boolean implicit,
AssociationType associationType,
java.lang.String tableAlias,
JoinType joinType,
java.lang.String[] columns)
Generate a join sequence representing the given association type.
|
JoinSequence |
createJoinSequence(boolean implicit,
AssociationType associationType,
java.lang.String tableAlias,
JoinType joinType,
java.lang.String[][] columns)
Generate a join sequence representing the given association type.
|
EntityPersister |
findEntityPersisterByName(java.lang.String name)
Locate the persister by class or entity name.
|
Type |
findFunctionReturnType(java.lang.String functionName,
antlr.collections.AST first)
Find the function return type given the function name and the first argument expression node.
|
Type |
findFunctionReturnType(java.lang.String functionName,
SQLFunction sqlFunction,
antlr.collections.AST firstArgument) |
static Queryable |
findQueryableUsingImports(SessionFactoryImplementor sfi,
java.lang.String className)
Given a (potentially unqualified) class name, locate its persister.
|
Queryable |
findQueryableUsingImports(java.lang.String className)
Given a (potentially unqualified) class name, locate its persister.
|
SQLFunction |
findSQLFunction(java.lang.String functionName)
Locate a registered sql function by name.
|
java.lang.String[][] |
generateColumnNames(Type[] sqlResultTypes) |
java.lang.String |
getAssociatedEntityName(CollectionType collectionType)
Given a collection type, determine the entity name of the elements
contained within instance of that collection.
|
java.lang.String[] |
getCollectionElementColumns(java.lang.String role,
java.lang.String roleAlias)
Retrieves the column names corresponding to the collection elements for the given
collection role.
|
QueryableCollection |
getCollectionPersister(java.lang.String role)
Locate the collection persister by the collection role.
|
PropertyMapping |
getCollectionPropertyMapping(java.lang.String role)
Retrieve a PropertyMapping describing the given collection role.
|
int |
getColumnSpan(Type type)
Retrieve the number of columns represented by this type.
|
AssociationType |
getElementAssociationType(CollectionType collectionType)
Essentially the same as
getElementType(org.hibernate.type.CollectionType) , but requiring that the
element type be an association type. |
SessionFactoryImplementor |
getFactory()
Get a handle to the encapsulated SessionFactory.
|
java.lang.String |
getIdentifierOrUniqueKeyPropertyName(EntityType entityType)
Determine the name of the property for the entity encapsulated by the
given type which represents the id or unique-key.
|
java.lang.String |
getImportedClassName(java.lang.String className)
Given a (potentially unqualified) class name, locate its imported qualified name.
|
boolean |
hasPhysicalDiscriminatorColumn(Queryable persister)
Does the given persister define a physical discriminator column
for the purpose of inheritance discrimination?
|
boolean |
isStrictJPAQLComplianceEnabled() |
EntityPersister |
requireClassPersister(java.lang.String name)
Locate the persister by class or entity name, requiring that such a persister
exist.
|
QueryableCollection |
requireQueryableCollection(java.lang.String role)
Locate the collection persister by the collection role, requiring that
such a persister exist.
|
public SessionFactoryHelper(SessionFactoryImplementor sfi)
sfi
- The SessionFactory impl to be encapsulated.public SessionFactoryImplementor getFactory()
public boolean hasPhysicalDiscriminatorColumn(Queryable persister)
persister
- The persister to be checked.public java.lang.String getImportedClassName(java.lang.String className)
className
- The potentially unqualified class namepublic Queryable findQueryableUsingImports(java.lang.String className)
className
- The (potentially unqualified) class name.public static Queryable findQueryableUsingImports(SessionFactoryImplementor sfi, java.lang.String className)
sfi
- The session factory implementor.className
- The (potentially unqualified) class name.public EntityPersister findEntityPersisterByName(java.lang.String name) throws MappingException
name
- The class or entity nameMappingException
public EntityPersister requireClassPersister(java.lang.String name) throws antlr.SemanticException
name
- The class or entity nameantlr.SemanticException
- Indicates the persister could not be foundpublic QueryableCollection getCollectionPersister(java.lang.String role)
role
- The collection role name.public QueryableCollection requireQueryableCollection(java.lang.String role) throws QueryException
role
- The collection role name.QueryException
- Indicates that the collection persister could not be found.public PropertyMapping getCollectionPropertyMapping(java.lang.String role)
role
- The collection role for which to retrieve the property mapping.public java.lang.String[] getCollectionElementColumns(java.lang.String role, java.lang.String roleAlias)
role
- The collection roleroleAlias
- The sql column-qualification alias (i.e., the table alias)public JoinSequence createJoinSequence()
public JoinSequence createJoinSequence(boolean implicit, AssociationType associationType, java.lang.String tableAlias, JoinType joinType, java.lang.String[] columns)
implicit
- Should implicit joins (theta-style) or explicit joins (ANSI-style) be renderedassociationType
- The type representing the thing to be joined into.tableAlias
- The table alias to use in qualifying the join conditionsjoinType
- The type of join to render (inner, outer, etc); see JoinFragment
columns
- The columns making up the condition of the join.public JoinSequence createJoinSequence(boolean implicit, AssociationType associationType, java.lang.String tableAlias, JoinType joinType, java.lang.String[][] columns)
implicit
- Should implicit joins (theta-style) or explicit joins (ANSI-style) be renderedassociationType
- The type representing the thing to be joined into.tableAlias
- The table alias to use in qualifying the join conditionsjoinType
- The type of join to render (inner, outer, etc); see JoinFragment
columns
- The columns making up the condition of the join.public JoinSequence createCollectionJoinSequence(QueryableCollection collPersister, java.lang.String collectionName)
collPersister
- The persister for the collection at which the join should be rooted.collectionName
- The alias to use for qualifying column references.public java.lang.String getIdentifierOrUniqueKeyPropertyName(EntityType entityType)
entityType
- The type representing the entity.QueryException
- Indicates such a property could not be found.public int getColumnSpan(Type type)
type
- The type.public java.lang.String getAssociatedEntityName(CollectionType collectionType)
collectionType
- The collection type to check.public AssociationType getElementAssociationType(CollectionType collectionType)
getElementType(org.hibernate.type.CollectionType)
, but requiring that the
element type be an association type.collectionType
- The collection type to be checked.public SQLFunction findSQLFunction(java.lang.String functionName)
functionName
- The name of the function to locatepublic Type findFunctionReturnType(java.lang.String functionName, antlr.collections.AST first)
functionName
- The function name.first
- The first argument expression.public Type findFunctionReturnType(java.lang.String functionName, SQLFunction sqlFunction, antlr.collections.AST firstArgument)
public java.lang.String[][] generateColumnNames(Type[] sqlResultTypes)
public boolean isStrictJPAQLComplianceEnabled()
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.