facebook

UPDATED: When Scaffolding DB – what to do with JOIN tables

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #309062 Reply

    davemeurer
    Member

    Hi All,

    We have clarification on this quick note about Scaffolding from a Database Tables:

    1. In the “Select Database Tables” wizard pane during scaffolding, add JOIN tables.
    2. In the “Database Scaffolding Options” wizard pane, more than likely you do NOT want to select the JOIN table.

    There may be cases when you need to use that table in the application, but if it only contains foreign keys, then MyEclipse for Spring / Hibernate will automatically use that table for the join without it being selected. It will not create an Entity for the JOIN table unless selected as a parent.

    Some examples of a 3rd join table are with Many-to-Many or uni-directional One-To-Many relationships.

    See the following screenshots:

    #313247 Reply

    joppert
    Member

    It seems that my version of myeclipse is insisting in generating the objects for join tables.

    #313248 Reply

    joppert
    Member

    @joppert wrote:

    It seems that my version of myeclipse is insisting in generating the objects for join tables.

    Could it be because my join tables have one field as primary key on it?

    I’ve noticed that users_authorities doesn’t, their ok is a composite key of both fields.

    Thanks

    #313249 Reply

    joppert
    Member

    @joppert wrote:

    It seems that my version of myeclipse is insisting in generating the objects for join tables.

    Could it be because my join tables have one field as primary key on it?

    I’ve noticed that users_authorities doesn’t, their ok is a composite key of both fields.

    Thanks

    #313252 Reply

    joppert
    Member

    OK, It works if not using a single PK field, I need to use a composite PK, then it omits my join tables.

    I guess I was just used to use a 3 fields join table to avoid having to write a PK class for each composite PK and its equals, and its hashcode, and its tostring, etc etc etc blerg!

    This tool does it all, in a fancy way, thanks a gain!

    Cheers,

    Ernani

    #313674 Reply

    jkennedy
    Member

    Thanks Ernani, we appreciate it.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: UPDATED: When Scaffolding DB – what to do with JOIN tables

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