|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.DataObjectUtils
Cayenne
class is used instead
@Deprecated public final class DataObjectUtils
A collection of utility methods to work with DataObjects.
DataObjects and Primary Keys: All methods that allow to extract primary key values or use primary keys to find objects are provided for convenience. Still the author's belief is that integer sequential primary keys are meaningless in the object model and are pure database artifacts. Therefore relying heavily on direct access to PK provided via this class (or other such Cayenne API) is not a clean design practice in many cases, and sometimes may actually lead to security issues.
Method Summary | ||
---|---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
compoundPKForObject(Persistent dataObject)
Deprecated. Returns a primary key map for a persistent object. |
|
static int |
intPKForObject(Persistent dataObject)
Deprecated. Returns an int primary key value for a persistent object. |
|
static long |
longPKForObject(Persistent dataObject)
Deprecated. Returns an int primary key value for a persistent object. |
|
static
|
objectForPK(ObjectContext context,
java.lang.Class<T> dataObjectClass,
int pk)
Deprecated. Returns an object matching an int primary key. |
|
static
|
objectForPK(ObjectContext context,
java.lang.Class<T> dataObjectClass,
java.util.Map<java.lang.String,?> pk)
Deprecated. Returns an object matching a primary key. |
|
static
|
objectForPK(ObjectContext context,
java.lang.Class<T> dataObjectClass,
java.lang.Object pk)
Deprecated. Returns an object matching an Object primary key. |
|
static java.lang.Object |
objectForPK(ObjectContext context,
ObjectId id)
Deprecated. Returns an object matching ObjectId. |
|
static java.lang.Object |
objectForPK(ObjectContext context,
java.lang.String objEntityName,
int pk)
Deprecated. Returns an object matching an int primary key. |
|
static java.lang.Object |
objectForPK(ObjectContext context,
java.lang.String objEntityName,
java.util.Map<java.lang.String,?> pk)
Deprecated. Returns an object matching a primary key. |
|
static java.lang.Object |
objectForPK(ObjectContext context,
java.lang.String objEntityName,
java.lang.Object pk)
Deprecated. Returns an object matching an Object primary key. |
|
static java.lang.Object |
objectForQuery(ObjectContext context,
Query query)
Deprecated. Returns an object or a DataRow that is a result of a given query. |
|
static java.lang.Object |
pkForObject(Persistent dataObject)
Deprecated. Returns a primary key value for a persistent object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static long longPKForObject(Persistent dataObject)
public static int intPKForObject(Persistent dataObject)
public static java.lang.Object pkForObject(Persistent dataObject)
public static java.util.Map<java.lang.String,java.lang.Object> compoundPKForObject(Persistent dataObject)
public static <T> T objectForPK(ObjectContext context, java.lang.Class<T> dataObjectClass, int pk)
If this object is already cached in the ObjectStore, it is returned without a query. Otherwise a query is built and executed against the database.
objectForPK(ObjectContext, ObjectId)
public static <T> T objectForPK(ObjectContext context, java.lang.Class<T> dataObjectClass, java.lang.Object pk)
If this object is already cached in the ObjectStore, it is returned without a query. Otherwise a query is built and executed against the database.
objectForPK(ObjectContext, ObjectId)
public static <T> T objectForPK(ObjectContext context, java.lang.Class<T> dataObjectClass, java.util.Map<java.lang.String,?> pk)
If this object is already cached in the ObjectStore, it is returned without a query. Otherwise a query is built and executed against the database.
objectForPK(ObjectContext, ObjectId)
public static java.lang.Object objectForPK(ObjectContext context, java.lang.String objEntityName, int pk)
If this object is already cached in the ObjectStore, it is returned without a query. Otherwise a query is built and executed against the database.
objectForPK(ObjectContext, ObjectId)
public static java.lang.Object objectForPK(ObjectContext context, java.lang.String objEntityName, java.lang.Object pk)
If this object is already cached in the ObjectStore, it is returned without a query. Otherwise a query is built and executed against the database.
objectForPK(ObjectContext, ObjectId)
public static java.lang.Object objectForPK(ObjectContext context, java.lang.String objEntityName, java.util.Map<java.lang.String,?> pk)
If this object is already cached in the ObjectStore, it is returned without a query. Otherwise a query is built and executed against the database.
objectForPK(ObjectContext, ObjectId)
public static java.lang.Object objectForPK(ObjectContext context, ObjectId id)
CayenneRuntimeException
- if more than one object matched ObjectId.public static java.lang.Object objectForQuery(ObjectContext context, Query query)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |