-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Associations not generated using Derby and Hibernate Tools
PostPosted: Sun Mar 14, 2010 6:28 am 
Newbie

Joined: Tue Mar 02, 2010 4:14 am
Posts: 2
Hi,

I have a Derby db embedded in Eclipse. I also have a hibernate configuration that connects to this DB successfully. When I generate the entities based on this schema, I get entities without the @joinColumn and oneToMany associations. I have checked the "detect associations" and "detect many-to-many tables".

Is this a known bug/feature?

What can I do to get this working?

Thanks!
Coenos

I use the following schema with foreign key relations.

Code:
CREATE TABLE CUSTOMERTYPE
(
   ID               integer          NOT NULL PRIMARY KEY generated always as identity,
   NAME          varchar(50)   NOT NULL,
   DESCRIPTION       varchar(50)   NOT NULL,
   VERSION          integer          NOT NULL
);

CREATE TABLE CUSTOMER
(
     ID               integer        NOT NULL PRIMARY KEY generated always as identity,
     NAME             varchar(50)   NOT NULL,
     ADDRESS          varchar(50)    NOT NULL,
     ZIP              varchar(10)    NOT NULL,
     CITY             varchar(50)    NOT NULL,
     COUNTRY          varchar(50)    NOT NULL,
     EMAIL            varchar(50),
     PHONE            varchar(50)    NOT NULL,
     CONTACT          varchar(50)    NOT NULL,
     CUSTOMERTYPE_ID  integer        NOT NULL,
     VERSION          integer          NOT NULL,
     CONSTRAINT CUS_CTP_FK1 FOREIGN KEY (CUSTOMERTYPE_ID) REFERENCES CUSTOMERTYPE(ID)
);


Top
 Profile  
 
 Post subject: Re: Associations not generated using Derby and Hibernate Tools
PostPosted: Mon Jul 26, 2010 6:03 am 
Newbie

Joined: Mon Sep 22, 2008 8:45 am
Posts: 5
Did you solve this? I'm having hard times with primary keys, if I ommit them on insert, it fails. Should we use derby with hibernate at all?

Table looks like this
Code:
CREATE TABLE students
(
id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
name VARCHAR(24) NOT NULL,
address VARCHAR(1024),
CONSTRAINT primary_key PRIMARY KEY (id)
) ;


Top
 Profile  
 
 Post subject: Re: Associations not generated using Derby and Hibernate Tools
PostPosted: Mon Jul 26, 2010 6:28 am 
Newbie

Joined: Tue Mar 02, 2010 4:14 am
Posts: 2
Nope, I switched to HSQLDB (embedded).

Derby does not (yet) support generation of key relations.

Regards,
Coen


Top
 Profile  
 
 Post subject: Re: Associations not generated using Derby and Hibernate Tools
PostPosted: Mon Jul 26, 2010 6:54 am 
Newbie

Joined: Mon Sep 22, 2008 8:45 am
Posts: 5
Coenos wrote:
Nope, I switched to HSQLDB (embedded).

Derby does not (yet) support generation of key relations.

Regards,
Coen


Thanks. I'm thinking about HSQLDB as well. Can you recommand it? But derby comes with JDK :/ Really don't know, I'm coming from PHP/MySQL world.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.