本文整理匯總了Java中javax.persistence.criteria.Root.getJoins方法的典型用法代碼示例。如果您正苦於以下問題:Java Root.getJoins方法的具體用法?Java Root.getJoins怎麽用?Java Root.getJoins使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.persistence.criteria.Root
的用法示例。
在下文中一共展示了Root.getJoins方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createSingleEntryDatabase
import javax.persistence.criteria.Root; //導入方法依賴的package包/類
protected void createSingleEntryDatabase() throws Exception {
VirtualDatabase newVDB = this.database.getClone();
Map<String, Objectref> createdObjectEntityMap = new HashMap<>();
for(Root<?> root : this.criteriaQuery.getRoots()) {
String rootClassName = root.getJavaType().getName();
EntityEntry rootEntityEntry = EntityAnalyzer.getInitialEntityEntry(rootClassName);
Objectref rootObjectref = getObjectrefByEntityEntry(rootClassName, rootEntityEntry);
createdObjectEntityMap.put(rootClassName, rootObjectref);
newVDB.addRequired(rootObjectref.getObjectId(), rootEntityEntry);
newVDB.addData(rootObjectref);
for(Join<?,?> join : root.getJoins()) {
handleJoin(newVDB, createdObjectEntityMap, join, rootObjectref);
}
}
String result = criteriaQuery.getResultType().getName();
Objectref singleObjectElement = createdObjectEntityMap.get(result);
Objectref singleResultListObjRef = getArrayListObjectref();
addObjectrefToArrayList(singleResultListObjRef, singleObjectElement);
SolverManager solverManager = ((SymbolicVirtualMachine) frame.getVm()).getSolverManager();
// imposeQueryRestrictionAsConstraints(createdObjectEntityMap, solverManager);
frame.getOperandStack().push(singleResultListObjRef);
((JPAVirtualMachine)frame.getVm()).setVirtualDatabase(newVDB);
}