| Author |
Message |
|
|
Post subject: Generating Data Objects From table?
Posted: Dec 15, 2004 - 03:52 PM
|
|

Joined: Sep 01, 2004
Posts: 33
|
|
Is it possible to generate simple java objects from a table definition with the current database tools?
If not this sure would be nice! |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Dec 15, 2004 - 04:46 PM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23824
|
|
1) Open the DB Explorer perspective
2) Connect to your DB
3) Expand the db to show the tables
4) Right click > Generate Hibernate Mapping
This will generate Hibernate POJOs with accompanying hbm.xml files describing them and updates your hibernate.cfg.xml file for you.
If you mean just the POJOs themselves without any mapping classes, then no, we don't just do that... although if you think it is helpful we can certainly look into adding it easily enough. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Dec 15, 2004 - 08:53 PM
|
|

Joined: Sep 01, 2004
Posts: 33
|
|
| support-rkalla wrote: | 1) Open the DB Explorer perspective
2) Connect to your DB
3) Expand the db to show the tables
4) Right click > Generate Hibernate Mapping
This will generate Hibernate POJOs with accompanying hbm.xml files describing them and updates your hibernate.cfg.xml file for you.
If you mean just the POJOs themselves without any mapping classes, then no, we don't just do that... although if you think it is helpful we can certainly look into adding it easily enough. |
It would be nice if there was an option to generate POJOS from the table definitions with the ability to specify the package and location. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Dec 15, 2004 - 08:57 PM
|
|

Joined: Sep 01, 2004
Posts: 33
|
|
| support-rkalla wrote: | 1) Open the DB Explorer perspective
2) Connect to your DB
3) Expand the db to show the tables
4) Right click > Generate Hibernate Mapping
This will generate Hibernate POJOs with accompanying hbm.xml files describing them and updates your hibernate.cfg.xml file for you.
If you mean just the POJOs themselves without any mapping classes, then no, we don't just do that... although if you think it is helpful we can certainly look into adding it easily enough. |
Actually thinking about it some more it may be appropriate to put this functionality in the new Class dialog by allowing the user to select from databases currently open in the database viewer. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Dec 15, 2004 - 10:02 PM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23824
|
|
Both good suggestions, I will file your comments as an enhancement. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
| |