Internal Website Search
101-150 of 200 resultsPersist error @ManyToMany how to define correct entities relationships Category but they are all refering to same limited set of Category entities (via ID ). There is not changes made to Category from Product. The category ID is taken from the webservice Object ID (unique too). @Entity public class Product implements Serializable { @ Id @GeneratedValue private long id | |
IdentifiableType | |
javax.persistence.ManyToMany", joinColumns= @JoinColumn(name="CUST_ ID ", referencedColumnName=" ID "), inverseJoinColumns= @JoinColumn(name="PHONE_ ID ", referencedColumnName=" ID ") ) public Set getPhones() { return phones; } // In | |
PersistenceUnitUtil.getIdentifier(entity) - JPA Method;entity ) Return the id of the entity. A generated id is not guaranteed to be available until after the database insert has occurred. Returns null if the entity does not yet have an id . Parameters: entity - entity instance Return: id of the entity Throws: IllegalArgumentException - if the object is found not to be an entity Since: JPA 2.0 | |
javax.persistence.JoinTable= @JoinColumn(name="CUST_ ID ", referencedColumnName=" ID "), inverseJoinColumns= @JoinColumn(name="PHONE_ ID ", referencedColumnName=" ID ") ) See Also: JoinColumn JoinColumns Since: JPA 1.0 Public Annotation | |
javax.persistence.PersistenceUnitUtil (Object entity) Return the id of the entity. A generated id is not guaranteed to be available until after the database insert has occurred. Returns null if the entity does not yet have an id . Parameters: entity - entity instance Return: id of the entity Throws: IllegalArgumentException | |
javax.persistence.MapKey is primary key public Map getEmployees() {... } ... } @Entity public class Employee { ... @ Id Integer getEmpId() { ... } @ManyToOne @JoinColumn(name="dept_ id ") public Department getDepartment ... (name="name") public Map getEmployees() {... } ... } @Entity public class Employee { @ Id public Integer | |
javax.persistence.ConstructorResult.createNativeQuery( "SELECT c. id , c.name, COUNT(o) as orderCount, AVG(o.price) AS avgOrder " + "FROM Customer c, Orders o " + "WHERE o.cid = c. id " + "GROUP BY c. id , c.name", "CustomerDetailsResult ... .CustomerDetails.class, columns={ @ColumnResult(name=" id "), @ColumnResult(name="name"), @ColumnResult | |
IdentifiableType | |
javax.persistence.MappedSuperclass elements. Example: Concrete class as a mapped superclass @MappedSuperclass public class Employee { @ Id ... ") protected Address address; public Integer getEmpId() { ... } public void setEmpId(Integer id ... ="ADDR_ ID ")) public class PartTimeEmployee extends Employee { // Inherited empId field mapped to PT_EMP | |
javax.persistence.EmbeddedId . There must be only one EmbeddedId annotation and no Id annotation when the EmbeddedId annotation is used ... may only be used to override those attributes of the embedded id that do not correspond to the relationship to the parent entity. Relationship mappings defined within an embedded id class are not supported | |
javax.persistence.EntityResult when insufficient data is available are undefined. Example: Query q = em.createNativeQuery( "SELECT o. id , o.quantity, o.item, i. id , i.name, i.description "+ "FROM Order o, Item i " + "WHERE (o.quantity 25) AND (o.item = i. id )", "OrderItemResults"); @SqlResultSetMapping(name="OrderItemResults", entities | |
javax.persistence.OneToMany; } In Order class: @ManyToOne @JoinColumn(name="CUST_ ID ", nullable=false) public Customer getCustomer ... getOrders() { return orders; } // In Order class: @ManyToOne @JoinColumn(name="CUST_ ID ", nullable=false ... ="CUST_ ID ") // join column is in table for Order public Set getOrders() {return orders;} Since: JPA 1 | |
IdentifiableType | |
javax.persistence.MapsId primary key @Entity public class Employee { @ Id long empId; String name; ... } // dependent entity uses ... id ; ... @MapsId("empid") // maps the empid attribute of embedded id @ManyToOne Employee emp | |
javax.persistence.PrimaryKeyJoinColumns({ @PrimaryKeyJoinColumn(name="CUST_ ID ", referencedColumnName=" ID "), @PrimaryKeyJoinColumn(name="CUST | |
javax.persistence.MapKeyColumn field or property; "_"; "KEY". Example: @Entity public class Item { @ Id int id ; ... @ElementCollection | |
javax.persistence.SecondaryTables_ ID ")), @SecondaryTable(name="EMP_HIST", pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPLOYEE_ ID | |
javax.persistence.Transient JPA Annotation Transient Target: METHOD, FIELD Implemented Interfaces: Annotation Specifies that the property or field is not persistent. It is used to annotate a property or field of an entity class, mapped superclass, or embeddable class. Example: @Entity public class Employee { @ Id int id | |
javax.persistence.SecondaryTable=@PrimaryKeyJoinColumn(name="CUST_ ID ")) public class Customer { ... } Example 2: Single secondary table ... _DETAIL", pkJoinColumns={ @PrimaryKeyJoinColumn(name="CUST_ ID "), @PrimaryKeyJoinColumn(name="CUST_TYPE")}) public class | |
IdentifiableType | |
javax.persistence.JoinColumns({ @JoinColumn(name="ADDR_ ID ", referencedColumnName=" ID "), @JoinColumn(name="ADDR_ZIP", referencedColumnName | |
javax.persistence.JoinColumn @JoinColumn(name="ADDR_ ID ") public Address getAddress() { return address; } Example: unidirectional ... _ ID ") // join column is in table for Order public Set getOrders() {return orders | |
javax.persistence.IdClass public class Employee { @ Id String empName; @ Id Date birthDay; ... } Since: JPA 1.0 Public Annotation | |
PersistenceManagerFactory.setServerTimeZoneID(timezoneid) - JDO Method timezoneid ) Sets the TimeZone ID of the server associated with this PersistenceManagerFactory. The parameter is a String suitable for use with TimeZone.getTimeZone(). The String must match an ID ... , assume that the server has the same TimeZone ID as the client. If incorrectly set, the result | |
javax.jdo.identity.ObjectIdentity represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 Object getKey () Return the key. Return: the key Since: JDO ... id . The class of the object id is written as the first part of the result so that the class | |
javax.jdo.JDOHelper (Collection pcs) Get object ids for a collection of instances. For each instance in the parameter ... of the parameter Collection. Parameters: pcs - the persistence-capable instances Return: the object ids ... Object[] getObjectIds (Object[] pcs) Get object ids for an array of instances. For each instance in | |
javax.jdo.PersistenceManager representation of the object id , or an object representation of a single field identity key Return ... ); Parameters: oid - The object id of the object to load Return: the corresponding persistent instance ... , Object key) This method returns an object id instance corresponding to the pcClass and key | |
JDOImplHelper.newObjectIdInstance(pcClass,obj) - JDO Method Class for JDO identity, using the key constructor of the object id class. It is intended for single ... class for the object id class, null is returned. For classes that use single field identity ... of the object id pcClass - the PersistenceCapable class. Return: the new ObjectId instance, or null if the class is not registered. Since: JDO 2.0 | |
javax.jdo.JDONullIdentityException An instance of this class is thrown when attempting to create an object id when the object id constructor parameter is null. This might occur when creating an object id instance from a transient instance | |
JDOImplHelper.copyKeyFieldsFromObjectId(pcClass,fm,oid) - JDO Method in the ObjectId. For example, an ObjectId class that has three key fields ( int id , String name ... (PersistenceCapable oid, ObjectIdFieldConsumer fm) { fm.storeIntField (0, oid. id ); fm.storeStringField (1, oid.name | |
JDOImplHelper.copyKeyFieldsToObjectId(pcClass,fm,oid) - JDO Method the ObjectId. For example, an ObjectId class that has three key fields ( int id , String name ... , ObjectIdFieldSupplier fm) { oid. id = fm.fetchIntField (0); oid.name = fm.fetchStringField (1); oid.salary | |
javax.jdo.identity.LongIdentity object id . Parameters: obj - the other object Return: true if both objects represent the same object id | |
IntIdentity.equals(obj) - JDO Method JDO Method in javax.jdo.identity.IntIdentity boolean equals ( Object obj ) Determine if the other object represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 | |
javax.jdo.identity.IntIdentity Since: JDO 2.2 boolean equals (Object obj) Determine if the other object represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id | |
ObjectIdentity.equals(obj) - JDO Method JDO Method in javax.jdo.identity.ObjectIdentity boolean equals ( Object obj ) Determine if the other object represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 | |
ObjectIdentity.toString() - JDO Method JDO Method in javax.jdo.identity.ObjectIdentity String toString () Return the String form of the object id . The class of the object id is written as the first part of the result so that the class can be reconstructed later. Then the toString of the key instance is appended. During construction | |
LongIdentity.equals(obj) - JDO Method JDO Method in javax.jdo.identity.LongIdentity boolean equals ( Object obj ) Determine if the other object represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 | |
javax.jdo.identity.ByteIdentity represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 byte getKey () Return the key. Return: the key Since: JDO 1.0 | |
CharIdentity.equals(obj) - JDO Method JDO Method in javax.jdo.identity.CharIdentity boolean equals ( Object obj ) Determine if the other object represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 | |
javax.jdo.identity.CharIdentity equals (Object obj) Determine if the other object represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 char | |
ByteIdentity.equals(obj) - JDO Method JDO Method in javax.jdo.identity.ByteIdentity boolean equals ( Object obj ) Determine if the other object represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 | |
JDOHelper.getObjectIds(pcs) - JDO Static Method JDO Static Method in javax.jdo.JDOHelper Object[] getObjectIds ( Object[] pcs ) Get object ids for an array of instances. For each instance in the parameter, the getObjectId method ... . Parameters: pcs - the persistence-capable instances Return: the object ids of the parameters | |
JDOHelper.getObjectIds(pcs) - JDO Static Method JDO Static Method in javax.jdo.JDOHelper Collection getObjectIds ( Collection pcs ) Get object ids for a collection of instances. For each instance in the parameter, the getObjectId ... of the parameter Collection. Parameters: pcs - the persistence-capable instances Return: the object ids | |
javax.jdo.spi.Detachable can set the object id , version, BitSet of loaded fields, and BitSet of modified fields ... of the Object[] jdoDetachedState is as follows: jdoDetachedState[0]: the Object Id of the instance | |
PersistenceManager.newObjectIdInstance(pcClass,key) - JDO Method JDO Method in javax.jdo.PersistenceManager Object newObjectIdInstance ( Class pcClass, Object key ) This method returns an object id instance corresponding ... identity, the result of toString() on the object id instance. Return: an instance of the object identity class Since: JDO 1.0 | |
ShortIdentity.equals(obj) - JDO Method JDO Method in javax.jdo.identity.ShortIdentity boolean equals ( Object obj ) Determine if the other object represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 | |
javax.jdo.identity.ShortIdentity the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 short getKey () Return the key. Return: the key Since: JDO 1.0 Object | |
StringIdentity.equals(obj) - JDO Method JDO Method in javax.jdo.identity.StringIdentity boolean equals ( Object obj ) Determine if the other object represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 | |
javax.jdo.identity.StringIdentity represents the same object id . Parameters: obj - the other object Return: true if both objects represent the same object id Since: JDO 1.0 String getKey () Return the key. Return: the key Since: JDO 1.0 |