- This topic has 11 replies, 6 voices, and was last updated 18 years, 4 months ago by
bragelonne.
-
AuthorPosts
-
Rick GenevaMemberVersion: 3.2.0
Build id: M20060629-1905BRING BACK THE OLD HIBERNATE MAPPING PLEASE!!!! Or at least have it as an option.
Why do all of the new Hibernate code generators make me create an ID object for every single bean I want to map? I mean, read the Hibernate website and where does it tell you that you must do that? How is this useful and why would I want to bother with it? This used to be a fairly straightforward process of mapping a POJO to a database table and now I have at least 4 files for everything I do. It’s so cluttered that I have a hard time navigating my project with all of these useless files. I’m so frustrated with it that I’m seriously considering going back to the older version of myeclipse. I pay for myeclipse to get the ‘goodies’ but for this particular ‘feature’ I can actually write the code and map it myself faster than what it takes to go back and clean up all the junk that was autogenerated. It appears that my only alternative is to create my own custom mapping template. The help files still show the previous version’s hibernate mapping wizard which is useless because the screen doesn’t even look the same anymore. So a custom template it is. I wish I would have known this before I payed another fifty bucks for renewal.
Haris PecoMemberrickgn,
We will update templates zip and documentation for MyEclipse 5.0 (it will be released next week).We can’t revert to old mappings, because it is much enhanced.You have to have ID (identifier) for every hibernate object (and every ORM tool at all), because it is only way that hibernate know identity of object.You have separate classes for ID if your primary keys are composite keys (PK with more columns).However, you will have templates and can make own mappings
Thanks
Rick GenevaMemberOk. I see your point on the ID object. Just to clarify my point, as an experienced developer I like my tools/IDE to ask me, remind me, etc. instead of going ahead and doing something that I did not want it to do. For example, if the little lightbulb next to an error in the main java editor would just do stuff for me instead of putting a lightbulb there I would never use the tool again. My suggestion would be to put a warning along with an explanation of what is about to happen when you have more than one key or the PK is missing.
Thank you for your quick response, and sorry about my grumpy attitude yesterday.
Haris PecoMemberrickgn ,
It’s problem that hibernate support bad tables without PK (and view for example) and bettter (but no complete good) composite Id.It isn’t blame for hibernate – it is very hard for resolving in some ORM tools – nobody do better
Thanks
Theo BriscoeMemberOn solution is to allow the developer to select the primary key from the lost of table columns. The functionality is avilable in IMB’s Rational Application Developer.
IntaxMemberHello, I have problem with this functionality. I have two tables – table_name and table_name_id. When I generate the Hibernate mapping for these tables, there is a name collision (class TableNameId and AbstractTableNameId). One of the tables “wins” – so finally I am missing two classes. MyEclipse doesn’t generate any warning about such situation. I tried to specify a different class name for one of the tables, but the value I entered is ignored.
Version: 5.0.1 GA
Build id: 20060810-5.0.1-GAThanks
Pavel
IntaxMemberHello, no response?
Pavel
Haris PecoMemberPavel,
When you specify a different class name you have to specify full class name, for example
com.yourpackage.YourClass
If you specify only YourClass class is created in default packageRegards,
Peco
Brian FernandesModeratorPavel,
In addition to what Peco mentioned above, please also read the following post in case you are running into a bug that was recently discovered in this area:
https://www.genuitec.com/forums/topic/a-small-request-for-hibernate-spring-reverse-engineering/#post-260220Do let us know how it turns out or if you need further clarification,
Brian.
bragelonneMemberhi guys,
i’m new to this forum and Hibernate. I’m having this topic’s opposite problem: i would like to force code generation of a ID class for a table which has a single primary key. Is that possible? (i understand that it’s not a very logical solution, but i have no control over the application’s architecture).
Thank you for your support.
IntaxMemberHi,
I think it IS the same problem as in the thread you mentioned – i wrote a comment there.
Anyway, I would expect the wizzard to notify me there is a class name collision.Thanks
Pavel
bragelonneMemberIf I understand correctly, rickgn’s problem was that he didn’t want to have automatic id classes generated for every table that has composite key. My problem is that I would like to have id classes created not only for tables with composite primary keys, but also for the tables with a single column primary key. Anybody know if there’s an option for that?
-
AuthorPosts