Examples of toStringID()


Examples of org.apache.cayenne.lifecycle.id.EntityIdCoder.toStringId()

        for (SelectQuery<DataObject> query : queriesByEntity.values()) {

            EntityIdCoder coder = codersByEntity.get(query.getRoot());
            List<DataObject> objects = context.performQuery(query);
            for (DataObject object : objects) {
                String uuid = coder.toStringId(object.getObjectId());
                results.put(uuid, object);
            }
        }

        return results;
View Full Code Here

Examples of org.apache.cayenne.lifecycle.id.EntityIdCoder.toStringId()

        when(entity.getDbEntity()).thenReturn(dbEntity);

        ObjectId id = new ObjectId("x", "ID", 3);

        EntityIdCoder coder = new EntityIdCoder(entity);
        assertEquals("x:3", coder.toStringId(id));

        ObjectId parsedId = coder.toObjectId("x:3");
        assertEquals(id, parsedId);
    }
View Full Code Here

Examples of org.apache.cayenne.lifecycle.id.EntityIdCoder.toStringId()

        when(entity.getDbEntity()).thenReturn(dbEntity);

        ObjectId id = new ObjectId("x", "ID", 3l);

        EntityIdCoder coder = new EntityIdCoder(entity);
        assertEquals("x:3", coder.toStringId(id));

        ObjectId parsedId = coder.toObjectId("x:3");
        assertEquals(id, parsedId);
    }
View Full Code Here

Examples of org.apache.cayenne.lifecycle.id.EntityIdCoder.toStringId()

        when(entity.getDbEntity()).thenReturn(dbEntity);

        EntityIdCoder coder = new EntityIdCoder(entity);

        ObjectId id = new ObjectId("x", "ID", "AbC");
        assertEquals("x:AbC", coder.toStringId(id));

        ObjectId parsedId = coder.toObjectId("x:AbC");
        assertEquals(id, parsedId);
    }
View Full Code Here

Examples of org.apache.cayenne.lifecycle.id.EntityIdCoder.toStringId()

        when(entity.getDbEntity()).thenReturn(dbEntity);

        EntityIdCoder coder = new EntityIdCoder(entity);

        ObjectId id = new ObjectId("x", "ID", "Ab:C");
        assertEquals("x:Ab%3AC", coder.toStringId(id));

        ObjectId parsedId = coder.toObjectId("x:Ab%3AC");
        assertEquals(id, parsedId);
    }
View Full Code Here

Examples of org.apache.cayenne.lifecycle.id.EntityIdCoder.toStringId()

        Map<String, Object> idMap = new HashMap<String, Object>();
        idMap.put("ID", "X;Y");
        idMap.put("ABC", 6783463l);
        idMap.put("ZZZ", "'_'");
        ObjectId id = new ObjectId("x", idMap);
        assertEquals("x:6783463:X%3BY:%27_%27", coder.toStringId(id));

        ObjectId parsedId = coder.toObjectId("x:6783463:X%3BY:%27_%27");
        assertEquals(id, parsedId);
    }
}
View Full Code Here

Examples of org.apache.cayenne.lifecycle.id.EntityIdCoder.toStringId()

        for (SelectQuery query : queriesByEntity.values()) {

            EntityIdCoder coder = codersByEntity.get(query.getRoot());
            List<DataObject> objects = context.performQuery(query);
            for (DataObject object : objects) {
                String uuid = coder.toStringId(object.getObjectId());
                results.put(uuid, object);
            }
        }

        return results;
View Full Code Here

Examples of org.apache.cayenne.lifecycle.id.EntityIdCoder.toStringId()

  public Object getEntityIdFrom(Object entity) {
    if (entity == null) return null;
    CayenneDataObject dataObject = (CayenneDataObject) entity;
    ObjEntity objEntity = Cayenne.getObjEntity(dataObject);
    EntityIdCoder entityIdCoder = new EntityIdCoder(objEntity);
    return entityIdCoder.toStringId(dataObject.getObjectId());     
  }
 
  /*
   * Expose the cayenne fields to allow for
   */
 
View Full Code Here

Examples of org.apache.cayenne.lifecycle.id.EntityIdCoder.toStringId()

  public Object getEntityIdFrom(Object entity) {
    if (entity == null) return null;
    CayenneDataObject dataObject = (CayenneDataObject) entity;
    ObjEntity objEntity = Cayenne.getObjEntity(dataObject);
    EntityIdCoder entityIdCoder = new EntityIdCoder(objEntity);
    return entityIdCoder.toStringId(dataObject.getObjectId());     
  }
 
  /*
   * Expose the cayenne fields to allow for
   */
 
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.IDMigrator.toStringID()

  }

  public void testStore() throws Exception {
    IDMigrator migrator = new MemoryIDMigrator();
    long id = migrator.toLongID(DUMMY_STRING);
    assertNull(migrator.toStringID(id));
    migrator.storeMapping(id, DUMMY_STRING);
    assertEquals(DUMMY_STRING, migrator.toStringID(id));
  }

  public void testInitialize() throws Exception {
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.