max wrote:
4nd3r5 wrote:
1. I do not want my hbm files to contain the name of the catalog and schema. The reasone for this is that I have a number of different databases both in production and test which have different names. Is there a way to specify that we do not want these attributes in the hbm files?
set default_schema and default_catalog and if the catalog/schema matches it won't end up in the mapping files.
Where do you set this? Which file?
Quote:
Quote:
2. I have been able to set the generated class attribute for all tables, using a CustomRevengStrategy and meta attributes. This does not work for classes with composite id's however . Here I have to specify manually the name of the composite id's base class in the meta attribute. Is there anyway to do this automatically?
Please report with instructions on how to reproduce in jira - sounds like a bug.
This is not a bug, it works fine, but i just cant create the second meta attribute in the below hbm file.
My hbm files look like this;
<class name="XXX1" table="XXX1">
<meta attribute="generated-class">XXX1Base</meta>
<composite-id name="XXX2" class="XXX2">
<meta attribute="generated-class">XXX2Base</meta>
.....
The first meta attibute is constructed by using a custom reveng strategy class where the method tableToMetaAttributes() is overwritten.
But can i do the same with the composite id meta attributes?
Quote:
Quote:
3. I have a number of property fields which are based on formulas in the hbm files. These would be nice to write in the hibernate reverse engineering file like in some way like; "....
<table name="XXX>
<column name="xxx" type="xxx" formula="xxxx"/>
</table>
But unfortunately this is not supported... Is there some other way to do this?
hmm..ever considered writing mapping files ? :)
reveng.xml is mostly about the relational info, but I guess we could add this in...just not sure sure how yet. Put it in jira.
p.s. you can always add it to the templates manually.,,
The thing is we really want the mapping files and pojos to be genererated automatically by reverse enginering and that is why i would like this ;-).
How would you do it with a template? I havent used these before...
Quote:
Quote:
4. On some of the tables is a <timestamp> property.
These are generated from hibernate as a <property name="xxx" type="timestamp">... instead of <timestamp name="xxx" coloumn="Xxx" />. Is there some way to control this?
you can write a custom revengstrategy that identifies xxx as the optimistic lock column.
OK so I just override the method "getOptimisticLockColumnName" and return i.e. modifiedDate as a string if that is the name of our timestamp coloumn?
Thanks for you reply btw...
/Anders