kariem wrote:
Instead setting the extends property and using
Code:
${pojo.getExtendsDeclaration()}
I just replace that part with this
Code:
extends my.supercool.base.Class
Don't think it should be that way
Well, it is one of the ways to do it (but does not work well if you have mapped any subclasses).
Quote:
Quote:
the docs explain how you can configure extends by meta attributes in the hbm.xml files.
What exactly are you looking for ?
I am trying do use the "Code Generation" Wizard provided by the Hibernate tools Eclipse plugin. I could not find any option to set the extends property without having HBM files. Currently the path is
JDBC => (HBM+DAO+POJO)
I cannot set anything on the HBM, because it is created in the same step.
So use a reveng.xml with something like:
Code:
<table-filter match-name=".*">
<meta attribute="extends">my.supercool.base.Class</meta>
</table-filter>
This will add the extends attribute for every table that is reverse engineered.
Quote:
Quote:
third one for what ?
the multiple directory/package thing is a known limitation at the moment (see jira)
- DAO => my.package.base.dao.hibernate
- POJO => my.package.base.model
- HBM => my.package.base.model (but other directory)
yes; this is on my todo list...
Quote:
Quote:
depend on what versyou you are using. the latest one have a properties view for each exporter.
again extends/implements is controlled through the mappings via meta attributes or use the reveng.xml. (we avoid to tie too much to some specific eclipse ui setting so it can actually be shared)
I recommend you read the docs for the various options/possibilities.
Sure I have the latest: beta 9 :) And I read through the docs.
I have created the reveng file and use it for the code generation. But, does it really provide the option to set the extends property? This would not be the right place.
It does provide that option (see above); and why don't you think that is the right place ?
The other option is to allow you to set a property on the codegeneration part (hbm2java to be exact) that says what is the default extends....that is on my todo; but not critical at the moment since you have the above options (and I like that the settings are not scattered too much).
Quote:
Quote:
What great integration features are you referring too ?
Most of the things that come with the hibernate tools are easier to use with myeclipse. And they provide a lot of glue stuff between hibernate and spring. With the
Add Hibernate Capabilities wizard you can
automatically add the libraries to the build path, or just reference the library.
This is one of my favorite love/hate features of most "integration" done with eclipse. People tend to forget that eclipse already provide a nice userlibrary configuration that does not require any special plugins.
Furthermore the libraries we would tend to bundle with the plugins would probably never be the exact version you want to use.
But yes, I do realize it is easier I've just refrained from adding this kind of setup since I feel eclipse already provides this functionallity (user libraries). But maybe I should just bite the bullet and add some sugar coating on top of those built in user libraries to help users setup hibernate; but still let the related projects classpath be independent of the plugins.
Quote:
The same functionallity that are in that screen (but not as limited/constrained) is very close to what we have...but yes we need to get the things you bumped into fixed/implemented to make it happen.
The conrecte dao generation is not spring bound; but that would be trivial for someone in the community to add/support.
Quote:
but what I liked most is the option to
include referenced or referencing tables during reverse engineering configuration.
Yes, we should have an easy switch for doing the same (to trivial to do to leave it out ;)
Could you explain what the difference is between the 4 lower checkboxe's ? I would naively think only 2 of them would be needed...(one of each)
Quote:
Quote:
(you do realize that large parts of myeclipse hibernate tooling is based upon an old fork of hibernate tools and they basically decided not to give back any of the enhancements they made - at least i'm still waiting for them ;) ...them using and old fork also means they don't have the immense improvements that have been added to hibernate tools since they decided to have their "own version"
Sure, that's the main problem for me with myeclipse. It seems they have great features, but if you look at it in more detail, you cannot really do a lot of customization. When I saw the velocity templates for the spring libraries I knew I would not want to do the customization with myeclipse.
are they that bad ? :) Anyway I hope myeclipse keeps up their promise to make sure that they stay compatible with hibernate tools so you at least can use the newer/fixed features while inside myeclipse.
Quote:
Quote:
what options are you missing exactly ?
Sorry, I admit that my message was not very exact.
Eclipse plugin -
Hibernate Code Generation should support
- Setting more properties for POJO and DAO generation, especially implements and extends. Currently only global settings can be set (Java 5, EJB 3), but I would really like all my classes implement one interface, or let the hibernate tools create the toString and hashCode methods.
the interface implements part is controllable by meta attributes (and thus can be configured in reveng.xml)
the tostring and hashcode (and don't forget equals) is also possible to enable but *definitly* not recommended to do blindly since it is *bad*.
I would definitly hope myeclipse does not allow that to be toggled globally!
What is the code they generate for that ?
Quote:
Different output folders for different exporters. Schema documentation is usually not at the same place as HBM filesgot ya!
Quote:
What I really need is some documentation on how to really use the templates. How can I set the file names for generated DAOs (currently it is set to ${declarationName}Home.
only possible with hbmtemplate from ant at the moment.
Quote:
Quote:
Feel free to jump in and provide patches.
Sure, if I find a solution I would be proud to support such a great project. With little time in my hands this task is quite difficult, but such a quick answer really motivates :)
Giving feedback/ideas and telling what works and what does not work is also very much welcomed!