IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.projector.annotations
Annotation Type Entity


@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface Entity

Specifies that this class is an entity.

Since:
WAS XD 6.1

Optional Element Summary
 AccessType accessType
          If specified, override the access type of this entity.
 String name
          The unqualified name for this entity.
 boolean schemaRoot
          Specifies that this entity is the root entity for the schema.
 Class supersetEntity
          Identifies the class in which this entity is a subset.
 

name

public abstract String name
The unqualified name for this entity. The name is used to refer to the entity in queries.

If the name is unspecified, the unqualified name of the entity class will be used.

If the name specified is that of an entity that already exists, this entity must include a subset of the existing entity. An entity sub-set provides the entire key and/or a partial value of the parent entity and is most useful in client/server environments to reduce the amount of data that is transported across the network transport layer.

Returns:
the name of the entity.
Default:
""

supersetEntity

public abstract Class supersetEntity
Identifies the class in which this entity is a subset. Subset entities are smaller views of the actual entity stored in a TupleStore. The most common use of a subset entity is in client/server environments where the server's entity may have many fields, but a client request need only see a few of those fields.

Subset entities have the following properties:

Example:
 @Entity(name="Person")
 public class Person {
   @Id long taxId;
   @Id String countryCode;
   String firstName;
   String lastName;
   String middleName;
   @ManyToOne Address homeAddress;
   String favoriteColor;
   String hatSize;
   String hairColor;
   String eyeColor;
   ...
 }

 // Subset entities have the same name, just a different class.
 @Entity(name="Person")
 public class PersonReadOnlyView {
   String firstName;
   String lastName;
   String middleName;
 }

 @Entity(name="Person")
 public class PersonReadWriteView {
   @Id long taxId;
   @Id String countryCode;
   String firstName;
   String lastName;
   String middleName;
   @ManyToOne Address homeAddress;
 }

 

Returns:
that class of the entity that this entity is a subset.
Default:
void.class

accessType

public abstract AccessType accessType
If specified, override the access type of this entity. This attribute is not normally required unless the entity has no key.

Returns:
the AccessType for this entity.
Default:
com.ibm.websphere.projector.annotations.AccessType.DEFAULT

schemaRoot

public abstract boolean schemaRoot
Specifies that this entity is the root entity for the schema. Each schema (projector instance) can only have one root. Entity managers may use the root for routing in partitioned environments.

Returns:
true if this is the root entity of the schema.
Default:
false

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.