Examples of load()


Examples of org.hibernate.IdentifierLoadAccess.load()

     */
    @SuppressWarnings("unchecked")
    public T get(PK id) {
        Session sess = getSession();
        IdentifierLoadAccess byId = sess.byId(persistentClass);
        T entity = (T) byId.load(id);

        if (entity == null) {
            log.warn("Uh oh, '" + this.persistentClass + "' object with id '" + id + "' not found...");
            throw new ObjectRetrievalFailureException(this.persistentClass, id);
        }
View Full Code Here

Examples of org.hibernate.NaturalIdLoadAccess.load()

    CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
       
    final NaturalIdLoadAccess naturalIdLoadAccess = this.tryNaturalIdLoadAccess( criteriaImpl );
    if ( naturalIdLoadAccess != null ) {
      // EARLY EXIT!
      return Arrays.asList( naturalIdLoadAccess.load() );
    }

    errorIfClosed();
    checkTransactionSynchStatus();
    String[] implementors = factory.getImplementors( criteriaImpl.getEntityOrClassName() );
View Full Code Here

Examples of org.hibernate.Session.load()

   * @throws IOException
   */
  public static void forceDelete(int log_id) throws Exception{
    Session ssn = getSession();
    try{
      DiaryBean log = (DiaryBean)ssn.load(DiaryBean.class, new Integer(log_id));
      beginTransaction();
      //����������ռ����Ӧ�ķ����ռ�����һ
      if(log.getStatus()==DiaryBean.STATUS_NORMAL){
        log.getCatalog().incArticleCount(-1);
      }
View Full Code Here

Examples of org.hibernate.classic.Session.load()

    int count = s.createQuery( "update versioned IntegerVersioned set name = name" ).executeUpdate();
    assertEquals( "incorrect exec count", 1, count );
    t.commit();

    t = s.beginTransaction();
    entity = ( IntegerVersioned ) s.load( IntegerVersioned.class, entity.getId() );
    assertEquals( "version not incremented", initialVersion + 1, entity.getVersion() );

    s.delete( entity );
    t.commit();
    s.close();
View Full Code Here

Examples of org.hibernate.event.EventSource.load()

      final Object entity;
      if ( original instanceof HibernateProxy ) {
        LazyInitializer li = ( (HibernateProxy) original ).getHibernateLazyInitializer();
        if ( li.isUninitialized() ) {
          log.trace("ignoring uninitialized proxy");
          event.setResult( source.load( li.getEntityName(), li.getIdentifier() ) );
          return; //EARLY EXIT!
        }
        else {
          entity = li.getImplementation();
        }
View Full Code Here

Examples of org.hibernate.event.spi.EventSource.load()

      final Object entity;
      if ( original instanceof HibernateProxy ) {
        LazyInitializer li = ( (HibernateProxy) original ).getHibernateLazyInitializer();
        if ( li.isUninitialized() ) {
          LOG.trace( "Ignoring uninitialized proxy" );
          event.setResult( source.load( li.getEntityName(), li.getIdentifier() ) );
          return; //EARLY EXIT!
        }
        else {
          entity = li.getImplementation();
        }
View Full Code Here

Examples of org.hibernate.loader.entity.UniqueEntityLoader.load()

          MessageHelper.infoString( this, id, getFactory() )
        );
    }

    final UniqueEntityLoader loader = getAppropriateLoader( lockMode, session );
    return loader.load( id, optionalObject, session );
  }

  private UniqueEntityLoader getAppropriateLoader(LockMode lockMode, SessionImplementor session) {
    final Map enabledFilters = session.getEnabledFilters();
    if ( queryLoader != null ) {
View Full Code Here

Examples of org.hibernate.ogm.OgmSession.load()

    tx.commit();
    session.clear();
    tx = session.beginTransaction();

    EntityWithObjectIdAndEmbeddable loaded = (EntityWithObjectIdAndEmbeddable) session.load( EntityWithObjectIdAndEmbeddable.class, entity.getId() );

    // then
    assertThat( loaded.getId() ).isEqualTo( entity.getId() );
    assertThat( loaded.getAnEmbeddable().getEmbeddedString() ).isEqualTo( entity.getAnEmbeddable().getEmbeddedString() );
    assertThat( loaded.getAnEmbeddable().getAnotherEmbeddable() ).isEqualTo( entity.getAnEmbeddable().getAnotherEmbeddable() );
View Full Code Here

Examples of org.hibernate.ogm.datastore.neo4j.impl.Neo4jGraphDatabaseServiceFactoryProvider.load()

  @Test
  public void testEmbeddedIsTheDefaultGraphDatabaseService() throws Exception {
    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, Neo4jTestHelper.dbLocation() );
    Neo4jGraphDatabaseServiceFactoryProvider graphService = new Neo4jGraphDatabaseServiceFactoryProvider();
    GraphDatabaseService db = graphService.load( properties, new ClassLoaderServiceImpl() ).create();
    db.shutdown();
    assertThat( db.getClass() ). isEqualTo( EmbeddedGraphDatabase.class );
  }

  @Test
View Full Code Here

Examples of org.hibernate.persister.entity.EntityPersister.load()

   
    evictCachedCollections( persister, id, source.getFactory() );
   
    String previousFetchProfile = source.getFetchProfile();
    source.setFetchProfile("refresh");
    Object result = persister.load( id, object, event.getLockMode(), source );
    source.setFetchProfile(previousFetchProfile);
   
    UnresolvableObjectException.throwIfNull( result, id, persister.getEntityName() );

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.