com.ibm.websphere.objectgrid.em
Class ProjectorFactory
java.lang.Object
com.ibm.websphere.objectgrid.em.ProjectorFactory
public class ProjectorFactory
- extends Object
A factory for creating or retrieving Projector instances.
Example:
// Get a session and it's EntityManager instance.
Session s = grid.getSession();
EntityManager em = s.getEntityManager();
// Get the Projector that is associated with the EntityManager.
Projector proj = ProjectorFactory.getProjector(em);
// Retrieve the EntityMetadata for the "Person" entity type.
EntityMetadata emdPerson = s.getObjectMap("Person").getEntityMetadata();
// Find a Person object
Person p = (Person) em.find(Person.class, "123-45-6789");
// We can convert any entity to a Tuple. It can be new, detached or managed.
Tuple tKey = proj.getTupleFromEntity(p, emdPerson, true);
Tuple tValue = proj.getTupleFromEntity(p, emdPerson, false);
- Since:
- WAS XD 6.1.0.5
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProjectorFactory
public ProjectorFactory()
getProjector
public static Projector getProjector(EntityManager em)
- Retrieves the
Projector
associated with the specified EntityManager
.
- Parameters:
em
- The instance of the EntityManager to access the Projector.
- Returns:
- a
Projector
instance.
© Copyright International Business Machines Corp 2005,2012. All rights reserved.