Quantcast

HSQLDB not properly recognizing Primary Key from JPA Annotations

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

HSQLDB not properly recognizing Primary Key from JPA Annotations

Chris Pratt
I just asked this question over on Stack Overflow.  Does anyone here know the answer?


Thanks.
  (*Chris*)

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HSQLDB not properly recognizing Primary Key from JPA Annotations

Fred Toussi-2
This has nothing to do with HSQLDB.
 
The primary key for a table is always user-defined. In this case it is the JPA (Hibernate) that sends a statement such as CREATE TABLE X(Y INTEGER PRIMARY KEY, ..) to the database engine. Hibernate would create primary keys the same way with Oracle and HSQLDB. As someone commented on your question, the most likely cause is your Oracle schema is user-defined but you are relying on Hibernate to generate the primary key in your tests.
 
Fred
 
On Fri, Aug 8, 2014, at 00:04, Chris Pratt wrote:
I just asked this question over on Stack Overflow.  Does anyone here know the answer?
 
 
Thanks.
  (*Chris*)
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
_______________________________________________
Hsqldb-user mailing list

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HSQLDB not properly recognizing Primary Key from JPA Annotations

Chris Pratt
Fred,
  Is there a way to user define the schema with in-memory HSQLDB?
(*Chris*)


On Fri, Aug 8, 2014 at 1:03 AM, Fred Toussi <[hidden email]> wrote:
This has nothing to do with HSQLDB.
 
The primary key for a table is always user-defined. In this case it is the JPA (Hibernate) that sends a statement such as CREATE TABLE X(Y INTEGER PRIMARY KEY, ..) to the database engine. Hibernate would create primary keys the same way with Oracle and HSQLDB. As someone commented on your question, the most likely cause is your Oracle schema is user-defined but you are relying on Hibernate to generate the primary key in your tests.
 
Fred
 
On Fri, Aug 8, 2014, at 00:04, Chris Pratt wrote:
I just asked this question over on Stack Overflow.  Does anyone here know the answer?
 
 
Thanks.
  (*Chris*)
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
_______________________________________________
Hsqldb-user mailing list

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user



------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HSQLDB not properly recognizing Primary Key from JPA Annotations

Fred Toussi-2
Certainly. You just execute all the CREATE TABLE and related statements via JDBC. This can be done even when Hibernate is used.
 
Fred
 
On Fri, Aug 8, 2014, at 19:16, Chris Pratt wrote:
Fred,
  Is there a way to user define the schema with in-memory HSQLDB?
(*Chris*)
 
On Fri, Aug 8, 2014 at 1:03 AM, Fred Toussi <[hidden email]> wrote:
This has nothing to do with HSQLDB.
 
The primary key for a table is always user-defined. In this case it is the JPA (Hibernate) that sends a statement such as CREATE TABLE X(Y INTEGER PRIMARY KEY, ..) to the database engine. Hibernate would create primary keys the same way with Oracle and HSQLDB. As someone commented on your question, the most likely cause is your Oracle schema is user-defined but you are relying on Hibernate to generate the primary key in your tests.
 
Fred
 
On Fri, Aug 8, 2014, at 00:04, Chris Pratt wrote:
I just asked this question over on Stack Overflow.  Does anyone here know the answer?
 
 
Thanks.
  (*Chris*)
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
_______________________________________________
Hsqldb-user mailing list

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
 
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
_______________________________________________
Hsqldb-user mailing list

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Loading...