• Post Reply Bookmark Topic Watch Topic
  • New Topic

MiddleGen generate relations

 
Stan Sokolov
Ranch Hand
Posts: 120
Hibernate IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MiddleGen generates DTO and mapping files for Hibernate. Bisides defining all properties it generates full bunch all relations whenever it is necessary or not. Could this default behaviour be changed. I read all the docs available on middlegen web site and didn't find any clue that can help to solve the problem. Is everybody aware how this issue could be fixed?
 
Munish Dabra
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well as far my understanding it is not issue..
you can always control what middlegen creates using ANT.

Their are two ways of solving this..

1) using ant task

<many2many>
<tablea generate="true" name="LIBRARY" />
<jointable name="LIBRARY_BOOK" generate="false" />
<tableb generate="true" name="BOOK" />
</many2many>

2) or u can control by table ...

<table name="LIBRARY"></table>
now middlegen should generate mapping files for only LIBRARY table.and you can always add more <table> tags for more tables.

I hope that helps
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!