ObjectDB Database Search

1-50 of 137 results

AnnotationRef jakarta.persistence.GeneratedValue

JPA Annotation GeneratedValue Target: METHOD, FIELD Implemented Interfaces: Annotation Specifies a generation strategy for generated primary keys. The GeneratedValue annotation may be applied ... . The persistence provider is only required to support the GeneratedValue for simple primary keys

AnnotationAttrRef jakarta.persistence.GeneratedValue.generator

JPA Annotation Attribute in jakarta.persistence. GeneratedValue String generator default "" (Optional) The name of the primary key generator to use, as specified by the SequenceGenerator or TableGenerator annotation which declares the generator. The name defaults to the entity name of the entity in

AnnotationAttrRef jakarta.persistence.GeneratedValue.strategy

JPA Annotation Attribute in jakarta.persistence. GeneratedValue GenerationType strategy default AUTO (Optional) The primary key generation strategy that the persistence provider must use to generate the annotated entity primary key. Since: JPA 1.0

Auto Generated Values

Marking a field with the @ GeneratedValue annotation specifies that a value will be automatically ... @ GeneratedValue with the AUTO strategy: @Entity public class EntityWithAutoId1 { @Id @ GeneratedValue ... definition is equivalent: @Entity public class EntityWithAutoId2 { @Id @ GeneratedValue long id

JPA Primary Key

a primary key field: @Entity public class Project { @Id @ GeneratedValue long id; // still set ... ; @ GeneratedValue annotation specifies that the primary key is automatically allocated by ObjectDB. Automatic value ... If an entity has a primary key field that is not marked with @ GeneratedValue , automatic primary key

JPA Annotations for Value Generation

Automatically generated values are mainly useful for primary key fields, but are supported by ObjectDB also for regular (non primary key) persistent fields. At the field level, the @ GeneratedValue with an optional GenerationType strategy is specified: The @ GeneratedValue annotation

Persist error @ManyToMany how to define correct entities relationships

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

Step 2: Entity Class and Persistence Unit

. GeneratedValue ; import javax.persistence.Id; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @Id @ GeneratedValue Long id; private

Step 2: Entity Class and Persistence Unit

.Serializable; import java.sql.Date; import javax.persistence.Entity; import javax.persistence. GeneratedValue ... final long serialVersionUID = 1L; // Persistent Fields: @Id @ GeneratedValue Long id; private String

Step 2: Entity Class and Persistence Unit

. GeneratedValue ; import javax.persistence.Id; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @Id @ GeneratedValue Long id

Step 2: Entity Class and Persistence Unit

. GeneratedValue ; import javax.persistence.Id; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @Id @ GeneratedValue Long id; private String

Step 2: Define a JPA Entity Class

. GeneratedValue ; import javax.persistence.Id; @Entity public class Guest implements Serializable { private static final long serialVersionUID = 1L; // Persistent Fields: @Id @ GeneratedValue Long id; private

Step 2: Define a JPA Entity Class

; import javax.persistence. GeneratedValue ; import javax.persistence.Id; @Entity public class Guest ... @ GeneratedValue Long id; private String name; private Date signingDate; // Constructors: public

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

.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence. GeneratedValue ; import ... ;          @Id @ GeneratedValue private long id;   ... Serializable {             @Id @ GeneratedValue

Error 363 - Failed to read value of inverse relationship

I've got two objects: @Entity public class EEvent { @Id @ GeneratedValue (strategy = GenerationType ... implements Serializable { private static final long serialVersionUID = 1L; @Id @ GeneratedValue private Long ... @ GeneratedValue private Long id; @Temporal(TemporalType.TIMESTAMP) private Date sendDate = new Date

Find the error...JPA ENTITY HIBERNATE

.persistence.FetchType; import javax.persistence. GeneratedValue ; import javax.persistence.GenerationType ... Serializable { private static final long serialVersionUID = 1L; // @ GeneratedValue @Id @Column(name = "id") @ GeneratedValue (strategy = GenerationType.IDENTITY) private int id; @Column(name = "username") private

General Performance Issues Illustrated with a Specific Method

.persistence. GeneratedValue ; import javax.persistence.GenerationType; import javax.persistence.Id ... public class Client implements Serializable , Identifiable { // @Id @ GeneratedValue (strategy ... ; import javax.persistence. GeneratedValue ; import javax.persistence.GenerationType; import javax

EmbeddedId with Generated field value

annotation @ GeneratedValue like the following: Solution 1) class A { @Id @ GeneratedValue private long uid; ... } Solution 2) class CompositePK { @ GeneratedValue private long uid; ... } Actually I ... ) @Entity public static class A {     @Id @ GeneratedValue public long id;   

Uninitialized primary key (id = 0)

with no  @ GeneratedValue  and you do not initialize it manually. support Support Yes, at first, there is no @ GeneratedValue , but it do not work after I add this command: @ GeneratedValue ... ; @ GeneratedValue should solve the problem, unless you already have entity objects with IDs 0

@OneToMany(fetch = FetchType.LAZY) list is always null

= "b", allocationSize = 1) public class Parent { @Id @ GeneratedValue (strategy = GenerationType.SEQUENCE ... @ GeneratedValue (strategy = GenerationType.SEQUENCE, generator = "b") private int id; @ManyToOne ... ;EntityManagerFactory), it fails. Entities: @Entity public class Parent { @Id @ GeneratedValue (strategy

Step 2: Define a JPA Entity Class

Serializable { private static final long serialVersionUID = 1L; @Id @ GeneratedValue private long id

Step 2: Define a JPA Entity Class

static final long serialVersionUID = 1L; @Id @ GeneratedValue private long id; private int x; private

AnnotationRef jakarta.persistence.TableGenerator

is specified for the GeneratedValue annotation. A table generator may be specified on the entity class or ... , then the annotation defines a recipe for producing a default generator when a GeneratedValue annotation ... : See Also: GeneratedValue Since: JPA 1.0 The Auto Generated Values article explains how to use TableGenerator . Public

List of Enum Values in an entity

; import javax.persistence. GeneratedValue ; import javax.persistence.Id; import org.eummcr.datastore ... implements Serializable { private static final long  serialVersionUID = 1L; @Id @ GeneratedValue ... ;      @Id @ GeneratedValue Long id;       

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

.FetchType; import javax.persistence.FlushModeType; import javax.persistence. GeneratedValue ; import javax ... { @Entity public static class ParentEntity {   @Id   @ GeneratedValue   private long id ... ; @Id   @ GeneratedValue   private long id;   @ManyToOne(fetch = FetchType.LAZY

Merge with Parent/Child entities not possible

. GeneratedValue ; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax ... {   @Id   @ GeneratedValue   private long id;   @OneToMany(fetch = FetchType.LAZY ... ;   } } @Entity public static class ChildEntity {   @Id   @ GeneratedValue   private

How to use JOIN FETCH?

javax.persistence. GeneratedValue ; import javax.persistence.Id; import javax.persistence ... class Person {   @Id @ GeneratedValue private long id;   private String name;   ... ;   } } @Entity public static class Address {   @Id @ GeneratedValue private long id;  

ID format in objectdb 2.x for JDOHelper.getObjectId

: private @Id @ GeneratedValue long id; // JPA code and then the ID will be injected automatically ... @Id @ GeneratedValue long id; but i think it only works in case of JPA not with JDO. Do you the any ... anyway:     @Id @ GeneratedValue     private long id; This should work

Database Inconsistency or corruption

.IObjectValue {   @javax.persistence.Id   @javax.persistence. GeneratedValue (strategy ... ; @javax.persistence. GeneratedValue (strategy=javax.persistence.GenerationType.TABLE, generator ... ; @javax.persistence. GeneratedValue (strategy = javax.persistence.GenerationType.TABLE, generator

Criteria query error: Unexpected query token

long serialVersionUID = -7979088681300801112L; /** * Primary key for entity */ @Id // @ GeneratedValue ... ", initialValue = 1, allocationSize = 50) // @ GeneratedValue (strategy = GenerationType.SEQUENCE) @ GeneratedValue private Long id; /** * Version of object, supporting optimistic lock */ @Column (name = "opt

Remove an entity which attributes were changed - OptimisticLockException

;   @Id @ GeneratedValue long id;         int value ... .EntityManagerFactory; import javax.persistence. GeneratedValue ; import javax.persistence.Id; import javax.persistence ... ;     @ GeneratedValue         long id;  

Can a Set be a foreign key?

{     @Id @ GeneratedValue     private long characterId;   ... characterLocation; and: @Entity public class Cell {     @Id @ GeneratedValue    ... {     @Id @ GeneratedValue     private long cellID;  

AnnotationRef jakarta.persistence.SequenceGenerator

is specified for the GeneratedValue annotation. A sequence generator may be specified on the entity class ... , then the annotation defines a recipe for producing a default generator when a GeneratedValue

Bug: ClassCastException by retrieval

.persistence. GeneratedValue ; import javax.persistence.GenerationType; import javax.persistence.Id ... class Node { @Id     @ GeneratedValue (strategy=GenerationType.IDENTITY) int id

Double persist of Entity field with Cascade.ALL

follows: @Id @ GeneratedValue (strategy = GenerationType.AUTO) private Long id; private String ... fields are as follows: @Id @ GeneratedValue (strategy = GenerationType.AUTO) private Long id; private

ManyToMany Set is null

@ GeneratedValue     private long id;     @ManyToMany(fetch = FetchType. EAGER , cascade ... {     @Id @ GeneratedValue     private long id;     @ManyToMany(fetch

EntityManager refresh problem

.persistence.Entity; import javax.persistence. GeneratedValue ; import javax.persistence.Id; @Entity public class SimpleEntity {     @Id @ GeneratedValue private Long primaryKey;    

Join query problem with new statetment

BaseEntity implements Serializable, Convertable {     @ GeneratedValue (strategy ... , Convertable {     @ GeneratedValue (strategy = GenerationType.AUTO)     

Does ObjectDB support lazy loading?

A { @Id @ GeneratedValue Long id; @OneToMany(fetch=FetchType.LAZY, cascade=CascadeType.ALL) List list; } @Entity static class B { @Id @ GeneratedValue public Long id; int value; B(int value

EntityManager getMetamodel() causes crash

. GeneratedValue ; import javax.persistence.Id; /** * MyEntity */ @Entity public class MyEntity implements Serializable { private static final long serialVersionUID = 1L; @Id @ GeneratedValue private long

Error occured during initialization of boot layer

. GeneratedValue ; import javax.persistence.Id; @Entity public class RequirementDBEntity implements Serializable { /** * */ private static final long serialVersionUID = 5019171545896480392L; @Id @ GeneratedValue

Beginners questions

") @ GeneratedValue (strategy = GenerationType.AUTO) private Long id; @OneToMany (fetch=FetchType.LAZY,cascade ... ; @Id @Column(name = "ID") @ GeneratedValue (strategy = GenerationType.AUTO) private Long id

Date field Index is corrupted due to time change

.persistence.EntityManagerFactory; import javax.persistence. GeneratedValue ; import javax.persistence ... ;     @ GeneratedValue (strategy=GenerationType.SEQUENCE, generator="DateTime_sequence

failure to enforce NOT NULL for java.lang.String

: @Entity public class Request { public Request() { } @Id @ GeneratedValue (strategy=GenerationType ... @ GeneratedValue (strategy=GenerationType.IDENTITY)         private

openejb jpa jaas module

; @ GeneratedValue (strategy = GenerationType.SEQUENCE , generator = "gen") @Id private int principalId; public ... ") }) public class UserInfo implements Serializable { @ GeneratedValue (strategy = GenerationType.AUTO

EnumRef jakarta.persistence.GenerationType

JPA Enum GenerationType java.lang.Object ∟  java.lang.Enum ∟  jakarta.persistence.GenerationType Enumerates the defined primary key generation strategies. See Also: GeneratedValue Since: JPA 1.0 The Auto Generated Values article explains how to use GenerationType . Enum Constants AUTO

AnnotationRef jakarta.persistence.Id

property or field. Example: {@snippet : See Also: Column GeneratedValue EmbeddedId PersistenceUnitUtil

New entity objects are duplicated on merge cascading

        @ GeneratedValue (strategy = GenerationType.AUTO)    ... ; @Id         @ GeneratedValue (strategy = GenerationType.AUTO ... A {         @Id @ GeneratedValue long id;     

Inverse OneToMany Mapping and EmbeddedId

; import javax.persistence . EntityManager ; import javax.persistence . GeneratedValue ; import javax ... A {          @Id          @ GeneratedValue ... ;   @Id          @ GeneratedValue ( strategy = IDENTITY )  

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

extends AbstractEntity implements IAbstractEntity { @Id @Column(name = "account_id") @ GeneratedValue ... { @Id @Column(name = "project_id") @ GeneratedValue (strategy= GenerationType.TABLE) protected Long id