use of org.hibernate.persister.entity.Queryable in project hibernate-orm by hibernate.
the class QueryTranslatorImpl method getEntityPersisterForName.
private Queryable getEntityPersisterForName(String name) throws QueryException {
String type = getType(name);
Queryable persister = getEntityPersister(type);
if (persister == null) {
throw new QueryException("persistent class not found: " + type);
}
return persister;
}
use of org.hibernate.persister.entity.Queryable in project hibernate-orm by hibernate.
the class QueryTranslatorImpl method getPropertyMapping.
PropertyMapping getPropertyMapping(String name) throws QueryException {
PropertyMapping decorator = getDecoratedPropertyMapping(name);
if (decorator != null) {
return decorator;
}
String type = getType(name);
if (type == null) {
String role = getRole(name);
if (role == null) {
throw new QueryException("alias not found: " + name);
}
//.getElementPropertyMapping();
return getCollectionPersister(role);
} else {
Queryable persister = getEntityPersister(type);
if (persister == null) {
throw new QueryException("persistent class not found: " + type);
}
return persister;
}
}
use of org.hibernate.persister.entity.Queryable in project hibernate-orm by hibernate.
the class LocalTemporaryTableBulkIdStrategy method buildUpdateHandler.
@Override
public UpdateHandler buildUpdateHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
final UpdateStatement updateStatement = (UpdateStatement) walker.getAST();
final FromElement fromElement = updateStatement.getFromClause().getFromElement();
final Queryable targetedPersister = fromElement.getQueryable();
final IdTableInfoImpl tableInfo = getIdTableInfo(targetedPersister);
return new TableBasedUpdateHandlerImpl(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);
}
};
}
use of org.hibernate.persister.entity.Queryable in project hibernate-orm by hibernate.
the class PersistentTableBulkIdStrategy 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();
return new DeleteHandlerImpl(factory, walker, getIdTableInfo(targetedPersister));
}
use of org.hibernate.persister.entity.Queryable in project hibernate-orm by hibernate.
the class GlobalTemporaryTableBulkIdStrategy method buildUpdateHandler.
@Override
public UpdateHandler buildUpdateHandler(SessionFactoryImplementor factory, HqlSqlWalker walker) {
final UpdateStatement updateStatement = (UpdateStatement) walker.getAST();
final FromElement fromElement = updateStatement.getFromClause().getFromElement();
final Queryable targetedPersister = fromElement.getQueryable();
return new TableBasedUpdateHandlerImpl(factory, walker, getIdTableInfo(targetedPersister)) {
@Override
protected void releaseFromUse(Queryable persister, SharedSessionContractImplementor session) {
if (afterUseAction == AfterUseAction.NONE) {
return;
}
// clean up our id-table rows
cleanUpRows(getIdTableInfo(persister).getQualifiedIdTableName(), session);
}
};
}
Aggregations