@Override public RootGraphImplementor<?> createEntityGraph(String graphName) { return delegate.createEntityGraph( graphName ); }
@Override public <T> RootGraphImplementor<T> createEntityGraph(Class<T> rootType) { return delegate.createEntityGraph( rootType ); }
@SuppressWarnings("unchecked") private static <T> EntityGraph<T> merge(SessionImplementor session, Class<T> rootType, Object... graphs) { RootGraphImplementor<T> merged = session.createEntityGraph( rootType ); if ( graphs != null ) { for ( Object graph : graphs ) { merged.merge( (GraphImplementor<T>) graph ); } } return merged; }
private static <T> RootGraphImplementor<T> parse( final Class<T> rootType, final CharSequence graphText, final SessionImplementor session) { if ( graphText == null ) { return null; } final RootGraphImplementor<T> graph = session.createEntityGraph( rootType ); parseInto( (GraphImplementor<T>) graph, graphText, session.getSessionFactory() ); return graph; }
@Test public void testHHH10378IsNotFixedYet() { EntityManager entityManager = getOrCreateEntityManager(); RootGraphImplementor<GraphParsingTestEntity> graph = ( (SessionImplementor) entityManager ).createEntityGraph( GraphParsingTestEntity.class ); final SubGraphImplementor<GraphParsingTestSubentity> subGraph = graph.addSubGraph( "linkToOne", GraphParsingTestSubentity.class ); assertEquals( subGraph.getGraphedType().getJavaType(), GraphParsingTestSubentity.class ); final AttributeNodeImplementor<Object> subTypeAttrNode = subGraph.addAttributeNode( "sub" ); assert subTypeAttrNode != null; }
@Override public <T> RootGraphImplementor<T> createEntityGraph(Class<T> rootType) { return delegate.createEntityGraph( rootType ); }
@Override public RootGraphImplementor<?> createEntityGraph(String graphName) { return delegate.createEntityGraph( graphName ); }
@SuppressWarnings("unchecked") private static <T> EntityGraph<T> merge(SessionImplementor session, Class<T> rootType, Object... graphs) { RootGraphImplementor<T> merged = session.createEntityGraph( rootType ); if ( graphs != null ) { for ( Object graph : graphs ) { merged.merge( (GraphImplementor<T>) graph ); } } return merged; }
private static <T> RootGraphImplementor<T> parse( final Class<T> rootType, final CharSequence graphText, final SessionImplementor session) { if ( graphText == null ) { return null; } final RootGraphImplementor<T> graph = session.createEntityGraph( rootType ); parseInto( (GraphImplementor<T>) graph, graphText, session.getSessionFactory() ); return graph; }