Package com.caucho.amber.entity

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


      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

  {
    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

  {
    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

    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

      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

  {
    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

  {
    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

    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

      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

TOP

Related Classes of com.caucho.amber.entity.EntityKey

Copyright © 2018 www.massapicom. 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.