[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-971) generate class-code without overwriting existing extra class-code
Christoph Mayerhofer (JIRA)
noreply at atlassian.com
Thu Aug 9 12:17:13 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27788 ]
Christoph Mayerhofer commented on HBX-971:
------------------------------------------
The drawback of (1) is, that the @Table annotation from the generated super-class must be moved to the (self-created) subclass. I think it would be nicer to just extend the generated class and leave all hibernate-specific code and annotations in the super-class.
> generate class-code without overwriting existing extra class-code
> -----------------------------------------------------------------
>
> Key: HBX-971
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-971
> Project: Hibernate Tools
> Issue Type: Improvement
> Components: hbm2java
> Affects Versions: 3.2beta9
> Reporter: Christoph Mayerhofer
>
> I'm trying to re-generate my class-code from my database-schema without overwriting existing methods from my pojos. I think this isn't possible yet because the java-files are always overwritten after each generation. But there are 2 possibilities to get rid of this problem which are not very convenient in my opinion:
> (1) subclass the generated class with the @MappedSuperclass annotation and anotate the Subclass with @Entity and @Table.
> (2) modify the generation templates or use the MetaAttribute "classCode" within the ReverseEngineeringStrategy.
> The best approach would be that the generation scripts do not touch the extra class-code from the pojos. Perhaps someone of the developers can verify if this would be possible.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list