Home » Search

About GeneratedValue

21-30 of 130Refresh
Forum
3

Find the error...JPA ENTITY HIBERNATE

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

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

; import javax.persistence.EntityManagerFactory; import javax.persistence.GeneratedValue; import ... class OrderDat implements Serializable {             @Id @GeneratedValue private long id ... {             @Id @GeneratedValue private long id;             public List image
Issue
3

New entity objects are duplicated on merge cascading

();     }         @Entity     public static class Book {         @Id         @GeneratedValue(strategy ... static class Chapter {         @Id         @GeneratedValue(strategy = GenerationType.AUTO ... ();         emf.close();     }     @Entity     public static class A {         @Id @GeneratedValue
Forum
2

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

Parent { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "b ... { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "b") private int id ... : @Entity public class Parent { @Id @GeneratedValue(strategy = GenerationType.AUTO
Forum
2

Join performance in Objectdb

A {         @Id @GeneratedValue long id;         B b;         long bId;         C c;         long cId ... class B {         @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seqB ... static class C {         @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seqC
Forum
2

Uninitialized primary key (id = 0)

with no @GeneratedValue and you do not initialize it manually. Yes, at first, there is no @GeneratedValue, but it do not work after I add this command: @GeneratedValue(strategy=GenerationType.IDENTITY) Should I remove the whole db? TIA Adding @GeneratedValue should solve the problem, unless you already have entity
Forum
2

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 ... class A {     @Id @GeneratedValue public long id;     @Id public String zone; } public static
Forum
2

Can a Set<E> be a foreign key?

{     @Id @GeneratedValue     private long characterId;     private String characterName;     private Location characterLocation; and: @Entity public class Cell {     @Id @GeneratedValue ... can do this safely and retrieve it nicely later on: @Entity public class Cell {     @Id @GeneratedValue
Forum
2

Criteria query error: Unexpected query token

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

Database Inconsistency or corruption

{   @javax.persistence.Id   @javax.persistence.GeneratedValue(strategy = javax.persistence ... .GeneratedValue(strategy=javax.persistence.GenerationType.TABLE, generator="attributeGen")   @javax ... , metamodel.IValue {   @javax.persistence.Id   @javax.persistence.GeneratedValue(strategy = javax