Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Composite Primary key Sequence in JPA EclipseLink DynamicPersistence
Composite Primary key Sequence in JPA EclipseLink DynamicPersistence [message #1063005] Tue, 11 June 2013 18:28 Go to next message
Gaurav Gupta is currently offline Gaurav GuptaFriend
Messages: 9
Registered: June 2013
Location: India
Junior Member
Entity(DemoEntity) with two primary key (id1 , id2) both are auto-incremented but sequence is generated for 1st configured primary key id1 not for both composite pk.
Is it not possible to configure sequence for more than one property(pk)(column) in a Entity(table) ?

INFO: -------------------------Entity Initialization Start Output Generated by Program -----------------------
INFO: Entity  : [Key:DemoEntity]
INFO: Field   : [Key:id2] [Type:BASIC] [DataType:java.lang.Long]
INFO: Field   : [Key:id1] [Type:BASIC] [DataType:java.lang.Long]
INFO: Initializing Entity PrimaryKeys : [id2, id1]
INFO: Initializing Entity Sequencing : DemoEntity_id2_SEQ  :  id2
INFO: Initializing Entity Sequencing : DemoEntity_id1_SEQ  :  id1



EclipseLink Logging (using POSTGRESQL Database)
FINEST: Execute query DataModifyQuery(sql="CREATE TABLE DemoEntity (id2 BIGINT NOT NULL, id1 BIGINT NOT NULL, name VARCHAR(255), PRIMARY KEY (id2, id1))")
FINE: CREATE TABLE DemoEntity (id2 BIGINT NOT NULL, id1 BIGINT NOT NULL, name VARCHAR(255), PRIMARY KEY (id2, id1))
FINEST: CREATE TABLE / PRIMARY KEY will create implicit index "demoentity_pkey" for table "demoentity":00000 - null
FINEST: The table (DemoEntity) is created.
FINEST: Execute query DataReadQuery(sql="SELECT * FROM SEQUENCE WHERE SEQ_NAME = 'DemoEntity_id1_SEQ'")
FINE: SELECT * FROM SEQUENCE WHERE SEQ_NAME = DemoEntity_id1_SEQ
FINEST: Execute query DataModifyQuery(sql="INSERT INTO SEQUENCE(SEQ_NAME, SEQ_COUNT) values ('DemoEntity_id1_SEQ', 0)")
FINE: INSERT INTO SEQUENCE(SEQ_NAME, SEQ_COUNT) values (DemoEntity_id1_SEQ, 0)


No log Exist for second Primary Key id2 (no sequence inserted in table(SEQUENCE) for second primary key id2)

[Updated on: Wed, 12 June 2013 19:39]

Report message to a moderator

Re: Composite Primary key Sequence in JPA EclipseLink DynamicPersistence [message #1063935 is a reply to message #1063005] Sun, 16 June 2013 09:36 Go to previous message
Gaurav Gupta is currently offline Gaurav GuptaFriend
Messages: 9
Registered: June 2013
Location: India
Junior Member
Resolved , only one sequence is allowed per Entity .
Previous Topic:Please vote to publish standard JPA 2.0 & 2.1 jars to Maven
Next Topic:MultiTenant cache headache
Goto Forum:
  


Current Time: Thu Apr 25 13:45:57 GMT 2024

Powered by FUDForum. Page generated in 0.02926 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top