facebook

Generating Data Objects From table?

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #221164 Reply

    haobaba1
    Member

    Is it possible to generate simple java objects from a table definition with the current database tools?

    If not this sure would be nice!

    #221187 Reply

    Riyad Kalla
    Member

    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.

    #221224 Reply

    haobaba1
    Member

    @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.

    #221226 Reply

    haobaba1
    Member

    @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.

    #221238 Reply

    Riyad Kalla
    Member

    Both good suggestions, I will file your comments as an enhancement.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Generating Data Objects From table?

You must be logged in to post in the forum log in