MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Mork
Post subject: MyEclipse Rev. Eng for not drawing constraing lines  PostPosted: Jul 04, 2011 - 04:06 PM
Veteran Member
Veteran Member


Joined: Dec 09, 2004
Posts: 604

Hello,

I have a database that's defined below, but when I reverse engineer it in MyE to see the ERD, I don't have any line connections between the tables.

However, when I reverse engineer it into Hibernate domain objects from MyE, the 1:M relationships are correct (1:M between publisher and books, and 1:M between books and chapters).

Is there something I'm missing with MySQL and MYE's reverse engineering?

How do I get the constraint lines to show up.

Thanks,

- m

(Database below from Hibernate Recipes book)

-- ----------------------------
-- Table structure for `BOOK`
-- ----------------------------
DROP TABLE IF EXISTS `BOOK`;
CREATE TABLE `BOOK` (
`ISBN` varchar(50) NOT NULL DEFAULT '',
`BOOK_NAME` varchar(100) NOT NULL,
`PUBLISHER_CODE` varchar(4) DEFAULT NULL,
`PUBLISH_DATE` date NOT NULL,
`PRICE` int(11) NOT NULL,
PRIMARY KEY (`ISBN`),
KEY `ISBN` (`ISBN`),
KEY `PUBLISHER_CODE` (`PUBLISHER_CODE`),
CONSTRAINT `PUB` FOREIGN KEY (`PUBLISHER_CODE`) REFERENCES `publisher` (`CODE`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of `BOOK`
-- ----------------------------
INSERT INTO `BOOK` VALUES ('PBN123', 'Spring Recipes', '001', '2008-02-02', '30'), ('PBN456', 'Hibernate Recipes', '002', '2008-11-02', '40');

-- ----------------------------
-- Table structure for `CHAPTER`
-- ----------------------------
DROP TABLE IF EXISTS `CHAPTER`;
CREATE TABLE `CHAPTER` (
`BOOK_ISBN` varchar(50) NOT NULL DEFAULT '',
`IDX` int(11) NOT NULL,
`TITLE` varchar(100) NOT NULL,
`NUM_OF_PAGES` int(11) NOT NULL,
KEY `BOOK_ISBN` (`BOOK_ISBN`),
CONSTRAINT `ISBN` FOREIGN KEY (`BOOK_ISBN`) REFERENCES `book` (`ISBN`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Table structure for `PUBLISHER`
-- ----------------------------
DROP TABLE IF EXISTS `PUBLISHER`;
CREATE TABLE `PUBLISHER` (
`CODE` varchar(4) NOT NULL,
`PUBLISHER_NAME` varchar(100) NOT NULL,
`ADDRESS` varchar(200) NOT NULL,
PRIMARY KEY (`CODE`),
KEY `CODE` (`CODE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of `PUBLISHER`
-- ----------------------------
INSERT INTO `PUBLISHER` VALUES ('001', 'APress', 'New York, New York'), ('002', 'Manning', 'San Francisco, CA');
 
 View user's profile Send private message  
Reply with quote Back to top
support-swapna
Post subject: RE: MyEclipse Rev. Eng for not drawing constraing lines  PostPosted: Jul 05, 2011 - 06:48 AM



Joined: Nov 11, 2010
Posts: 2153

Mork,

1) Here is a tutorial for reverse engineering using Hibernate. Take a look:
http://www.myeclipseide.com/documentation/quickstarts/hibernateintroduction/#ReverseEngineering

2) Which version of MyEclipse are you working with ? Can you check if you see the same issue with constraint lines on Classic Eclipse version ? If you are working with MyEclipse 9, then the base Classic Eclipse version will be 3.6.

3) Also attach a visual for the issue you are seeing.

_________________
Swapna
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
Mork
Post subject: Re: RE: MyEclipse Rev. Eng for not drawing constraing lines  PostPosted: Jul 05, 2011 - 11:23 AM
Veteran Member
Veteran Member


Joined: Dec 09, 2004
Posts: 604

support-swapna wrote:
Mork,

1) Here is a tutorial for reverse engineering using Hibernate. Take a look:
http://www.myeclipseide.com/documentation/quickstarts/hibernateintroduction/#ReverseEngineering

2) Which version of MyEclipse are you working with ? Can you check if you see the same issue with constraint lines on Classic Eclipse version ? If you are working with MyEclipse 9, then the base Classic Eclipse version will be 3.6.

3) Also attach a visual for the issue you are seeing.


Thanks for your reply.

I'm using MyEcilpse for Spring, latest version (9.1 for the Skyway plug-in).

And, as I noted in my posting above (and in the actual database SQL), MyEclipse is generating the correct domain classes with the correct Set<> objects for the database 1:M relationships.

The only issue is that when I reverse engineer an ERD from the MySQL database, I don't get the lines between the tables. Instead, I just get the tables.

Not that it should matter, but I'm using the Mac version of MyEclipse for Spring.

I will email you a graphic of the ERD generated from the SQL above.

Perhaps you can create a MySQL database using the SQL above and try the ERD reverse engineering as well on your Mac version?

Look forward to hearing back.

Thanks.

m
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits