Home » Search

About GeneratedValue

31-40 of 127Refresh
Forum
2

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

.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence ... ; public class ObjectDbRemoveTest { @Entity public static class ParentEntity {   @Id   @GeneratedValue ... {   @Id   @GeneratedValue   private long id;   @ManyToOne(fetch = FetchType.LAZY, cascade
Forum
2

List of Enum Values in an entity

.GeneratedValue; import javax.persistence.Id; import org.eummcr.datastore.model.GuestFlag ... Serializable { private static final long  serialVersionUID = 1L; @Id @GeneratedValue Long ... ();     }     @Entity     public static class MyEntity {         @Id @GeneratedValue Long id
Forum
2

Merge with Parent/Child entities not possible

javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne ... public static class ParentEntity {   @Id   @GeneratedValue   private long id;   @OneToMany(fetch ... = id;   } } @Entity public static class ChildEntity {   @Id   @GeneratedValue   private
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

Remove an entity which attributes were changed - OptimisticLockException

();     }     @Entity     public static class MyEntity {         @Id @GeneratedValue long id ... ; import javax.persistence.EntityManagerFactory; import javax.persistence.GeneratedValue; import ...         @GeneratedValue         long id;         int value;     } }   Thanks. Build 2.8.0_01 should fix it. Thanks. The issue is solved with Build 2.8.0_01.
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

ID format in objectdb 2.x for JDOHelper.getObjectId

) to LongIdentity. Another option, you can add to your class an ID field: private @Id @GeneratedValue ... .objectdb.OID not LongIdentity. I tried adding private @Id @GeneratedValue long id; but i think ... an ID field anyway:     @Id @GeneratedValue     private long id; This should work
Forum
2

"Unsupported auto value type java.lang.String" when persisting new instance

. My annotations for primary key: @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private String ID; You cannot use @GeneratedValue for string Id only for numeric Ids. Id fields whose type is string have to be assigned a value by the application. kiki
Forum
2

@MappedSuperclass and @Transient not working as I expected

javax.persistence.EntityManagerFactory; import javax.persistence.GeneratedValue; import javax ... javax.persistence.Version; @MappedSuperclass public class DataObject { @Id @GeneratedValue
Forum
2

Beginners questions

@Column(name = "ID") @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @OneToMany (fetch ... static final long serialVersionUID = 1L; @Id @Column(name = "ID") @GeneratedValue(strategy