Examples of EntityKey


Examples of com.caucho.amber.entity.EntityKey

  public EntityItem putEntity(EntityType rootType,
                              Object key,
                              EntityItem entity)
  {
    SoftReference<EntityItem> ref = new SoftReference<EntityItem>(entity);
    EntityKey entityKey = new EntityKey(rootType.getInstanceClass(), key);

    ref = _entityCache.putIfNew(entityKey, ref);

    return ref.get();
  }
View Full Code Here

Examples of com.caucho.amber.entity.EntityKey

      iter = _entityCache.iterator();
      while (iter.hasNext()) {
        LruCache.Entry<EntityKey,SoftReference<EntityItem>> entry;
        entry = iter.next();

        EntityKey key = entry.getKey();
        SoftReference<EntityItem> valueRef = entry.getValue();
        EntityItem value = valueRef.get();

        if (value == null)
          continue;

        EntityType entityRoot = value.getEntityHome().getEntityType();
        Object entityKey = key.getKey();

        for (int i = 0; i < size; i++) {
          if (completions.get(i).complete(entityRoot, entityKey, value)) {
            // XXX: delete
          }
View Full Code Here

Examples of com.caucho.amber.entity.EntityKey

  {
    if (entity == null)
      throw new IllegalStateException(L.l("Null entity item cannot be added to the persistence unit cache"));

    SoftReference<EntityItem> ref = new SoftReference<EntityItem>(entity);
    EntityKey entityKey = new EntityKey(rootType.getInstanceClass(), key);

    // can't use putIfNew because the SoftReference might be empty, i.e.
    // not "new" but in need of replacement
    ref = _entityCache.put(entityKey, ref);
View Full Code Here

Examples of com.caucho.amber.entity.EntityKey

  {
    if (entity == null)
      throw new IllegalStateException(L.l("Null entity item cannot be added to the persistence unit cache"));

    SoftReference<EntityItem> ref = new SoftReference<EntityItem>(entity);
    EntityKey entityKey = new EntityKey(cl, key);

    // can't use putIfNew because the SoftReference might be empty, i.e.
    // not "new" but in need of replacement
    ref = _entityCache.put(entityKey, ref);
View Full Code Here

Examples of com.caucho.amber.entity.EntityKey

    synchronized (_entityKey) {
      _entityKey.init(rootType.getInstanceClass(), key);

      // jpa/0q00
      ref = new SoftReference<EntityItem>(cacheItem);
      EntityKey entityKey = new EntityKey(rootType.getInstanceClass(), key);

      // ejb/0628, ejb/06d0
      _entityCache.put(entityKey, ref);
    }
  }
View Full Code Here

Examples of com.caucho.amber.entity.EntityKey

      iter = _entityCache.iterator();
      while (iter.hasNext()) {
        LruCache.Entry<EntityKey,SoftReference<EntityItem>> entry;
        entry = iter.next();

        EntityKey key = entry.getKey();
        SoftReference<EntityItem> valueRef = entry.getValue();
        EntityItem value = valueRef.get();

        if (value == null)
          continue;

        AmberEntityHome entityHome = value.getEntityHome();
        EntityType entityRoot = entityHome.getEntityType();
        Object entityKey = key.getKey();

        for (int i = 0; i < size; i++) {
          if (completions.get(i).complete(entityRoot, entityKey, value)) {
            // XXX: delete
          }
View Full Code Here

Examples of org.hibernate.engine.EntityKey

      // key value upon which to perform the breaking logic.  However,
      // it is also then called from getRowFromResultSet() which is certainly
      // not the most efficient.  But the call here is needed, and there
      // currently is no other way without refactoring of the doQuery()/getRowFromResultSet()
      // methods
      final EntityKey currentKey = getKeyFromResultSet(
          0,
          getEntityPersisters()[0],
          null,
          resultSet,
          session
View Full Code Here

Examples of org.hibernate.engine.spi.EntityKey

    //cannot batch fetch by unique key (property-ref associations)
    //FIXME support non-pk unique id
    if ( //uniqueKeyPropertyName == null &&
        id != null ) {
      EntityPersister persister = session.getFactory().getEntityPersister( delegate.getAssociatedEntityName() );
      EntityKey entityKey = session.generateEntityKey( id, persister );
      if ( !session.getPersistenceContext().containsEntity( entityKey ) ) {
        session.getPersistenceContext().getBatchFetchQueue().addBatchLoadableEntityKey( entityKey );
      }
    }
  }
View Full Code Here

Examples of org.hibernate.ogm.grid.EntityKey

  }

  @Override
  public void lock(Serializable id, Object version, Object object, int timeout, SessionImplementor session) throws StaleObjectStateException, JDBCException {
    MapDatastoreProvider dataStore = getProvider( session );
    EntityKey key = EntityKeyBuilder.fromData(
        ( (OgmEntityPersister) lockable).getRootEntityKeyMetadata(),
        identifierGridType,
        id,
        session );
    dataStore.writeLock( key, timeout );
View Full Code Here

Examples of org.hibernate.ogm.grid.EntityKey

  }

  @Override
  public void lock(Serializable id, Object version, Object object, int timeout, SessionImplementor session) throws StaleObjectStateException, JDBCException {
    MapDatastoreProvider dataStore = getProvider( session );
    EntityKey key = EntityKeyBuilder.fromData(
        ( (OgmEntityPersister) lockable ).getRootEntityKeyMetadata(),
        identifierGridType,
        id,
        session );
    dataStore.readLock( key, timeout );
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.