Joined: Thu Jun 01, 2006 5:43 am Posts: 3
|
Hi,
I'm using hibernate annotations 3.2.0 CR1 with firebird database.
I want to use the sequence generator but it seems that hibernate uses the hilo generator internally.
My Class:
Code: @Entity @Table(name="MY_TEST") @SequenceGenerator(name="PK",sequenceName="SQ_MY_TEST_ID") public class MyTest { private Long id;
@Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="PK") public Long getId() { return id; }
public void setId(Long id) { this.id = id; } @Column(name="BEZEICHNUNG",length=200, unique=true) private String bezeichnung;
public String getBezeichnung() { return bezeichnung; }
public void setBezeichnung(String bezeichnung) { this.bezeichnung = bezeichnung; } } And the debug logging information: 11:34:17,944 DEBUG JDBCTransaction:54 - begin 11:34:17,945 DEBUG ConnectionManager:415 - opening JDBC connection 11:34:17,946 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0 11:34:17,951 DEBUG DriverManagerConnectionProvider:99 - using pooled JDBC connection, pool size: 0 11:34:17,951 DEBUG JDBCTransaction:59 - current autocommit status: false 11:34:17,952 DEBUG JDBCContext:203 - after transaction begin 11:34:17,964 DEBUG AbstractSaveEventListener:489 - transient instance of: test.MyTest 11:34:17,964 DEBUG DefaultSaveOrUpdateEventListener:161 - saving transient instance 11:34:17,965 DEBUG AbstractBatcher:358 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0) 11:34:17,965 DEBUG SQL:393 - select gen_id( SQ_MY_TEST_ID, 1 ) from RDB$DATABASE 11:34:17,966 DEBUG AbstractBatcher:476 - preparing statement 11:34:17,969 DEBUG SequenceGenerator:82 - Sequence identifier generated: 7 11:34:17,969 DEBUG AbstractBatcher:366 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1) 11:34:17,970 DEBUG AbstractBatcher:525 - closing statement 11:34:17,971 DEBUG SequenceHiLoGenerator:62 - new hi value: 7 11:34:17,971 DEBUG AbstractSaveEventListener:113 - generated identifier: 350, using strategy: org.hibernate.id.SequenceHiLoGenerator 11:34:17,976 DEBUG AbstractSaveEventListener:152 - saving [test.MyTest#350] 11:34:17,983 DEBUG JDBCTransaction:103 - commit 11:34:17,984 DEBUG SessionImpl:339 - automatically flushing session 11:34:17,984 DEBUG AbstractFlushingEventListener:58 - flushing session 11:34:17,985 DEBUG AbstractFlushingEventListener:111 - processing flush-time cascades 11:34:17,986 DEBUG AbstractFlushingEventListener:153 - dirty checking collections 11:34:17,987 DEBUG AbstractFlushingEventListener:170 - Flushing entities and processing referenced collections 11:34:17,989 DEBUG AbstractFlushingEventListener:209 - Processing unreferenced collections 11:34:17,989 DEBUG AbstractFlushingEventListener:223 - Scheduling collection removes/(re)creates/updates 11:34:17,990 DEBUG AbstractFlushingEventListener:85 - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects 11:34:17,990 DEBUG AbstractFlushingEventListener:91 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections 11:34:17,991 DEBUG Printer:83 - listing entities: 11:34:17,995 DEBUG Printer:90 - test.MyTest{bezeichnung=yuio, traversal=0, id=350} 11:34:17,995 DEBUG AbstractFlushingEventListener:289 - executing flush 11:34:17,995 DEBUG ConnectionManager:463 - registering flush begin 11:34:17,996 DEBUG AbstractEntityPersister:2090 - Inserting entity: [test.MyTest#350] 11:34:17,996 DEBUG AbstractBatcher:358 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0) 11:34:17,997 DEBUG SQL:393 - insert into MY_TEST (bezeichnung, traversal, id) values (?, ?, ?) 11:34:17,997 DEBUG AbstractBatcher:476 - preparing statement 11:34:17,999 DEBUG AbstractEntityPersister:1905 - Dehydrating entity: [test.MyTest#350] Any hint's what I'm doing wrong? Thanks a lot, Chris[/code]
|
|