Internal Website Search

51-100 of 200 results

Persist error @ManyToMany how to define correct entities relationships

too). @Entity public class Product implements Serializable { @Id @GeneratedValue private long id ... Category implements Serializable { @Id private long id; public Category(int id) { this.id = id ... implements Serializable { @Id //@GeneratedValue private long id; @ManyToMany(cascade=CascadeType.PERSIST

General Performance Issues Illustrated with a Specific Method

listPatientsByIDsWithBasicData(String ids) { Long st = new Date().getTime(); System.out.println ... ); System.out.println("cs size = " + cs.size()); Long ed = new Date().getTime(); System.out.println ... = GenerationType.AUTO) private Long id; private static final long serialVersionUID = 1L; @Index @OneToOne

Inserted entities with strings as keys and indices needs more and more ram memory in comparing to primitive integers as keys and indices

programs demonstrate well that automatic  long primary keys are indeed much more efficient ... be filled to the maximum with new objects. Long values consume less  space than String UID and are processed faster. support Support Thank you for the clarification. The example with long keys needs

Optimistic locking: prevent version increment on entity collection attribute

;  @Id private long id;        @OneToMany(mappedBy="document")     private ArrayList readings = new ArrayList ();        public long ... ;   @Id private long id;     private Document document = null;   

ClassCastException on SELECT NEW ... after UPDATE over Java RMI

is (simple bean): public class FileNameDTO { private Long id; private String fileName; public FileNameDTO( Long id, String fileName) { this.id = id; this.fileName = fileName; } public Long getId() { return id; } public void setId( Long id) { this.id = id; } public String getFileName() { return fileName

Need help to make this test work and define proper annotations for entities Lists

;          @Id @GeneratedValue private long id;   ... ;          public long getId() {     ... ;    public void setId( long id) {          

Composite Index error 328

class UsrlistEntity implements Serializable { private static final long serialVersionUID = -4472890635861972890L; private int id; private int dyId; private long pwd; private String usrName; private ... surname; private String job; private String phoneNumber; private Long contactHash; private String

Date field Index is corrupted due to time change

;   em.getTransaction().begin();         Long r = ( Long ... ; em.getTransaction().begin();         r = ( Long ) q ... roundDownDateTime(Date dateTime) {         long dateTimeMs = dateTime.getTime

Error 363 - Failed to read value of inverse relationship

.AUTO) private long id; @ManyToOne(optional=false) private ETown town; public ETown getTown ... implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue private Long ... public class Message implements Serializable { private static final long serialVersionUID = 1L; @Id

Is it possible to remove parent/child entities without refresh?

{ @Entity public static class ParentEntity {   @Id   @GeneratedValue   private long id ... (), child);   }   public long getId() {    return id;   }   public void setId( long id) {    this.id = id;   } } @Entity public static class ChildEntity {  

Wrong data stored in time only fields

;   Long r = ( Long ) q.getSingleResult();           ... ) {         long dateTimeMs = dateTime.getTime();         long reminderMs  = dateTimeMs % 1000;      

TemporalType injection with Calendar using JPA

Calendar may be supported in the future - but as long as it is not portable JPA - it should be avoided ... have replaced the Calendar fields with " long " data types which represent the millisecond value of the Date ... TimePeriod implements Serializable { private long beginTime; private long endTime; private String

Multi part paths in a composite index must have the same length

; private static final long serialVersionUID = 998L;     @Id @GeneratedValue long id;     @Index private Long instrumentId;     private SafeLong tStamp; The SafeLong class is a very simple wrapper of a long -  @Embeddable public class SafeLong

IDs of Entities suddenly became UUIDs?

do have a UUID String as their id instead of Long which is of course causing a lot of troubles. Note that this even occurrs on the same "Table" -- some saved Entitities of same type do still have a Long ID, others a String UUID. Our Base-Entity everything inherits from is declared as usual with Long

EmbeddedId with Generated field value

********* @Entity @IdClass(CompositePK.class) public class A {     @Id private long uid ... ;private long uid;     private String zone; } ********* Solution 2 ... {     private long uid;     private String zone; } In

Failing to read entities under load in multithreaded tests

TestIdHolder implements Serializable{     private static final long serialVersionUID = 1L;     private long version;     private long longId;   ... ="TestIdTableGen")     public long getLongId() {      

Database Inconsistency or corruption

", valueColumnName = "idValue", pkColumnValue = "objectValueId", allocationSize = 1)   protected Long id;   private String type;   private Long revision;   protected boolean ... ; String type,       Long revision,       Project project

Should derived fields of an EmbeddedId be manually maintained by app code?

+ numberToGen; int startCnt = lastInstanceInMap; long timing = System.currentTimeMillis(); while (endCnt ... "); q.setParameter("container", this); q.setFlushMode(FlushModeType.AUTO); try { long l = ( Long ) q ... implements Serializable { private static final long serialVersionUID = 0L; private String cachedKey; private

Unable to persist fields in subclass

) public abstract class SimpleAbstractPersonTest { private long addressID; private long contactID ... lastNameProperty() { return lastName; } public final long getAddressID() { return addressID; } public final void setAddressID( long id) { if (id 0) addressID = id; } public final long getContactID

Join query problem with new statetment

Serializable {     private static final long serialVersionUID = 1L;     private long inspID;     private String inspName;     private long productID;     private String productName;     

Visibility of changes in Transaction is not visible to a JPA QL Query

to see that they have been added long newTotal = -1;   try {    InitialContext ... ; .lookup("SLSBObjDb");    long oldAmount = bean.countItems();    bean.addItems ... ;  lastInstance = startCnt;   } } public long howManyItemsExist(EntityManager em) {  

Merge with Parent/Child entities not possible

{   @Id   @GeneratedValue   private long id;   @OneToMany(fetch = FetchType.LAZY ... (this);    children.put(child.getChildName(), child);   }   public long getId() {    return id;   }   public void setId( long id) {    this.id = id

failure to enforce NOT NULL for java.lang.String

.IDENTITY) private Long id; @Unique @Persistent(nullValue=NullValue.EXCEPTION) private String username; public Long getId() { return id; } public void setId( Long id) { this.id = id; } public String ... Long id;         @Unique       

javax.persistence.criteria.CriteriaBuilder

an aggregate expression applying the sum operation to an Integer-valued expression, returning a Long ... same expression object. Parameters: number - numeric expression Return: Expression< Long >

javax.persistence.GeneratedValue

_ID") public Long getId() { return id; } Example 2: @Id @GeneratedValue(strategy=TABLE, generator="CUST_GEN") @Column(name="CUST_ID") Long id; See Also: Id TableGenerator SequenceGenerator Since: JPA 1

javax.persistence.Version

, Integer , short , Short , long , Long , java.sql.Timestamp . Example: @Version @Column(name="OPTLOCK

javax.persistence.Convert

{ ... } @Entity public class Employee { @Id long id; @Convert(converter=BooleanToIntegerConverter.class ... Employee { @Id long id; ... // EmployeeDateConverter is applied automatically EmployeeDate startDate

javax.persistence.MapsId

primary key @Entity public class Employee { @Id long empId; String name; ... } // dependent entity uses EmbeddedId for composite key @Embeddable public class DependentId { String name; long empid

javax.persistence.LockModeType

.PESSIMISTIC_WRITE , and LockModeType.PESSIMISTIC_FORCE_INCREMENT are used to immediately obtain long

javax.persistence.MapKeyJoinColumn

="MOVIE", referencedColumnName="ID") Map videoInventory; ... } @Entity public class Movie { @Id long

javax.persistence.OrderColumn

. Example: @Entity public class CreditCard { @Id long ccNumber; @OneToMany // unidirectional @OrderColumn

CriteriaBuilder.toLong(number) - JPA Method

JPA Method in javax.persistence.criteria.CriteriaBuilder Expression toLong (    Expression  number ) Typecast. Returns same expression object. Parameters: number - numeric expression Return: Expression< Long > Since: JPA 2.0

CriteriaBuilder.sumAsLong(x) - JPA Method

JPA Method in javax.persistence.criteria.CriteriaBuilder Expression sumAsLong (    Expression  x ) Create an aggregate expression applying the sum operation to an Integer-valued expression, returning a Long result. Parameters: x - expression representing input value to sum operation Return: sum expression Since: JPA 2.0

javax.persistence.Id

: @Id public Long getId() { return id; } See Also: Column GeneratedValue Since: JPA 1.0 The JPA

After using the enhancer, Lazy loaded collections are no longer loading. They are set as null

(strategy= GenerationType.TABLE) protected Long id; @Override public Long getId() { return id; } @Override public void setId( Long id) { this.id = id; } @OneToMany(cascade={CascadeType.MERGE ... { @Id @Column(name = "project_id") @GeneratedValue(strategy= GenerationType.TABLE) protected Long id

[ObjectDB 2.2.5_02] Unexpected exception (Error 990) com.objectdb.o.InternalException: java.lang.NullPointerException: null

TimePeriod implements Serializable { private long beginTime; private long endTime; private String periodType; public long getBeginTime() { return beginTime; } public void setBeginTime( long beginTime) { this.beginTime = beginTime; } public long getEndTime() { return endTime; } public void setEndTime( long

StateManager.setLongField(pc,field,currentValue,newValue) - JDO Method

JDO Method in javax.jdo.spi.StateManager void setLongField (   PersistenceCapable pc,    int field,     long  currentValue,     long  newValue ) Mark the field as modified by the user. Parameters: pc - the calling

Sequence.nextValue() - JDO Method

JDO Method in javax.jdo.datastore.Sequence long nextValue () Returns the next sequence value as a long . If the next sequence value is not available or is not numeric, throw JDODataStoreException. Return: the next value Since: JDO 2.0

Sequence.currentValue() - JDO Method

JDO Method in javax.jdo.datastore.Sequence long currentValue () Returns the current sequence value as a long . If the current sequence value is not available or is not numeric, throw JDODataStoreException. Return: the current value Since: JDO 2.0

StateManager.getLongField(pc,field,currentValue) - JDO Method

JDO Method in javax.jdo.spi.StateManager long getLongField (   PersistenceCapable pc,    int field,     long  currentValue ) Return the value for the field. Parameters: pc - the calling PersistenceCapable instance field - the field number

LongIdentity.LongIdentity(pcClass,key) - JDO Constructor

JDO Constructor in javax.jdo.identity.LongIdentity LongIdentity (   Class pcClass,     long  key ) Constructor with class and key. Parameters: pcClass - the class key - the key Since: JDO 1.0

LongIdentity.LongIdentity(pcClass,key) - JDO Constructor

JDO Constructor in javax.jdo.identity.LongIdentity LongIdentity (   Class pcClass,     Long  key ) Constructor with class and key. Parameters: pcClass - the class key - the key Since: JDO 1.0

StateManager.providedLongField(pc,field,currentValue) - JDO Method

JDO Method in javax.jdo.spi.StateManager void providedLongField (   PersistenceCapable pc,    int field,     long  currentValue ) The value of the field requested to be provided to the StateManager . Parameters: pc - the calling

StateManager.replacingLongField(pc,field) - JDO Method

JDO Method in javax.jdo.spi.StateManager long replacingLongField (   PersistenceCapable pc,    int field ) The replacement value of the field in the calling instance. Parameters: pc - the calling PersistenceCapable instance field - the field number Return: the new value for the field Since: JDO 1.0

LongIdentity.getKey() - JDO Method

JDO Method in javax.jdo.identity.LongIdentity long getKey () Return the key. Return: the key Since: JDO 1.0

Query.setRange(fromInclToExcl) - JDO Method

JDO Method in javax.jdo.Query void setRange (   String fromInclToExcl ) Set the range of results to return. The parameter is a String containing a comma-separated fromIncl and toExcl. The fromIncl and toExcl can be either String representations of long values, or can be parameters

Query.setResultClass(cls) - JDO Method

, Integer, Long , Float, Double, String, or Object[]; or one of the java.math classes BigInteger or

Query.deletePersistentAll() - JDO Method

JDO Method in javax.jdo.Query long deletePersistentAll () Deletes all the instances of the candidate class that pass the filter. Returns the number of instances of the candidate class that were deleted, specifically not including the number of dependent and embedded instances. Dirty instances

Query.deletePersistentAll(parameters) - JDO Method

JDO Method in javax.jdo.Query long deletePersistentAll (   Map parameters ) Deletes all the instances of the candidate class that pass the filter. Parameters: parameters - for the query Return: the number of instances of the candidate class that were deleted See Also: deletePersistentAll () Since: JDO 2.0

Query.deletePersistentAll(parameters) - JDO Method

JDO Method in javax.jdo.Query long deletePersistentAll (   Object... parameters ) Deletes all the instances of the candidate class that pass the filter. Parameters: parameters - for the query Return: the number of instances of the candidate class that were deleted See Also: deletePersistentAll () Since: JDO 2.0