use of org.hibernate.hql.internal.ast.tree.FromElement in project hibernate-orm by hibernate.
the class HqlSqlWalker method createFromElement.
@Override
protected AST createFromElement(String path, AST alias, AST propertyFetch) throws SemanticException {
FromElement fromElement = currentFromClause.addFromElement(path, alias);
fromElement.setAllPropertyFetch(propertyFetch != null);
return fromElement;
}
use of org.hibernate.hql.internal.ast.tree.FromElement in project hibernate-orm by hibernate.
the class HqlSqlWalker method lookupAlias.
@Override
protected void lookupAlias(AST aliasRef) throws SemanticException {
FromElement alias = currentFromClause.getFromElement(aliasRef.getText());
FromReferenceNode aliasRefNode = (FromReferenceNode) aliasRef;
aliasRefNode.setFromElement(alias);
}
use of org.hibernate.hql.internal.ast.tree.FromElement in project hibernate-orm by hibernate.
the class HqlSqlWalker method beforeSelectClause.
@Override
protected void beforeSelectClause() throws SemanticException {
// Turn off includeSubclasses on all FromElements.
FromClause from = getCurrentFromClause();
List fromElements = from.getFromElements();
for (Iterator iterator = fromElements.iterator(); iterator.hasNext(); ) {
FromElement fromElement = (FromElement) iterator.next();
fromElement.setIncludeSubclasses(false);
}
}
use of org.hibernate.hql.internal.ast.tree.FromElement in project hibernate-orm by hibernate.
the class SqlGenerator method nestedFromFragment.
@Override
protected void nestedFromFragment(AST d, AST parent) {
// to determine if a comma is required between them
if (d != null && hasText(d)) {
if (parent != null && hasText(parent)) {
// again, both should be FromElements
FromElement left = (FromElement) parent;
FromElement right = (FromElement) d;
if (right.getRealOrigin() == left) {
// right represents a joins originating from left...
if (right.getJoinSequence() != null && right.getJoinSequence().isThetaStyle()) {
writeCrossJoinSeparator();
} else {
out(" ");
}
} else {
// not so sure this is even valid subtree. but if it was, it'd
// represent two unrelated table references...
writeCrossJoinSeparator();
}
}
out(d);
}
}
use of org.hibernate.hql.internal.ast.tree.FromElement in project hibernate-orm by hibernate.
the class LocalTemporaryTableBulkIdStrategy method buildDeleteHandler.
@Override
public DeleteHandler buildDeleteHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
final DeleteStatement updateStatement = (DeleteStatement) walker.getAST();
final FromElement fromElement = updateStatement.getFromClause().getFromElement();
final Queryable targetedPersister = fromElement.getQueryable();
final IdTableInfoImpl tableInfo = getIdTableInfo(targetedPersister);
return new TableBasedDeleteHandlerImpl(factory, walker, tableInfo) {
@Override
protected void prepareForUse(Queryable persister, SharedSessionContractImplementor session) {
Helper.INSTANCE.createTempTable(tableInfo, ddlTransactionHandling, session);
}
@Override
protected void releaseFromUse(Queryable persister, SharedSessionContractImplementor session) {
Helper.INSTANCE.releaseTempTable(tableInfo, afterUseAction, ddlTransactionHandling, session);
}
};
}
Aggregations