-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problems with reverse engineering creating relationships.
PostPosted: Mon May 27, 2013 4:22 am 
Newbie

Joined: Mon May 27, 2013 4:20 am
Posts: 1
I'm using Eclipse with Hibernate Tools to do reverse engineering. I get the classes but all the relationshipt between them are missed. So, it doesn't matter if there're many-to-many or whatever because they are not on my classes.

Right now, I am only trying with two tables:

CREATE TABLE `ROOMS` (
`idROOMS` int(11) NOT NULL,
`ROOM_NAME` varchar(45) DEFAULT NULL,
`OWNER` int(11) DEFAULT NULL,
`IS_PRIVATED` tinyint(1) DEFAULT NULL,
`CREATED_DATE` datetime DEFAULT NULL,
PRIMARY KEY (`idROOMS`),
UNIQUE KEY `UNI_NAME_ROOM` (`ROOM_NAME`),
KEY `FK_OWNER_idx` (`OWNER`),
CONSTRAINT `FK_OWNER` FOREIGN KEY (`OWNER`) REFERENCES `USERS` (`idUSERS`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `USERS` (
`idUSERS` int(11) NOT NULL,
`USER_NAME` varchar(50) DEFAULT NULL,
`KEY_ID` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`idUSERS`),
UNIQUE KEY `UNI` (`USER_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
It's not correctly defined the relationship between the tables?

I'm getting something like:

/**
* Users generated by hbm2java
*/
@Entity
@Table(name = "USERS", catalog = "test_hibernate", uniqueConstraints = @UniqueConstraint(columnNames = "USER_NAME"))
public class Users implements java.io.Serializable {

private int idUsers;
private String userName;
private String keyId;
...

@Entity
@Table(name = "ROOMS", catalog = "test_hibernate", uniqueConstraints = @UniqueConstraint(columnNames = "ROOM_NAME"))
public class Rooms implements java.io.Serializable {

private int idRooms;
private String roomName;
private Integer owner; --> I'd like getting a Set<Users> or something like that, I think that it's as Hibernate works.
private Boolean isPrivated;
private Date createdDate;


Top
 Profile  
 
 Post subject: Re: Problems with reverse engineering creating relationships.
PostPosted: Fri Jun 21, 2013 2:45 pm 
Newbie

Joined: Fri Jun 21, 2013 2:44 pm
Posts: 1
Did you find a solution to this issue? Having the same problem with Sybase reverse engg.


Top
 Profile  
 
 Post subject: Re: Problems with reverse engineering creating relationships.
PostPosted: Sat Jun 14, 2014 4:33 am 
Newbie

Joined: Sat Jun 14, 2014 4:32 am
Posts: 1
Hi,
i know this is an old thread, but has there been a solution? ... I ran into the same problem
cheers
funky


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.