Search in sources :

Example 1 with EntityGraphBuilder

use of com.vladmihalcea.hibernate.model.util.EntityGraphBuilder in project vladmihalcea.wordpress.com by vladmihalcea.

the class HibernateBagMultiLevelFetchTest method reconstructForest.

protected BagForest reconstructForest(List<BagLeaf> leaves, Long forestId) {
    EntityGraphBuilder entityGraphBuilder = new EntityGraphBuilder(new EntityVisitor[] { BagLeaf.ENTITY_VISITOR, BagBranch.ENTITY_VISITOR, BagTree.ENTITY_VISITOR, BagForest.ENTITY_VISITOR }).build(leaves);
    ClassId<BagForest> forestClassId = new ClassId<BagForest>(BagForest.class, forestId);
    return entityGraphBuilder.getEntityContext().getObject(forestClassId);
}
Also used : BagForest(com.vladmihalcea.hibernate.model.baglist.BagForest) EntityVisitor(com.vladmihalcea.hibernate.model.util.EntityVisitor) ClassId(com.vladmihalcea.hibernate.model.util.ClassId) EntityGraphBuilder(com.vladmihalcea.hibernate.model.util.EntityGraphBuilder)

Aggregations

BagForest (com.vladmihalcea.hibernate.model.baglist.BagForest)1 ClassId (com.vladmihalcea.hibernate.model.util.ClassId)1 EntityGraphBuilder (com.vladmihalcea.hibernate.model.util.EntityGraphBuilder)1 EntityVisitor (com.vladmihalcea.hibernate.model.util.EntityVisitor)1