[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-946) Add a general meta for all the tables in the database, see [HBX-575]

Ale Feltes Quenhan (JIRA) noreply at atlassian.com
Thu Sep 13 16:58:14 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28094 ] 

Ale Feltes Quenhan commented on HBX-946:
----------------------------------------

I have one of thisrequirements too, I need my Domain POJO's to extends form a BaseDominio class. I did a CustomExtendsStrategy , with the single method overrided, but one strange thing is that DelegatingReverseEngineeringStrategy does not have it, I made a test putting some "hard" trace, printing something to a file, and the constructor is called, but never the method tableToMetaAttributes: 

public Map tableToMetaAttributes(TableIdentifier tableIdentifier,String tableName) {
	      Map<String, MetaAttribute> metaAttributes = new HashMap<String, MetaAttribute>();
{
  MetaAttribute extendsCode = new MetaAttribute("extends");
  extendsCode.addValue("BaseDominio");
  metaAttributes.put("extends", extendsCode);
  return metaAttributes;
}

Any ideas?
Thanks in advance.



> Add a general meta for all the tables in the database, see [HBX-575]
> --------------------------------------------------------------------
>
>                 Key: HBX-946
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-946
>             Project: Hibernate Tools
>          Issue Type: Improvement
>          Components: reverse-engineer
>    Affects Versions: 3.2beta9
>         Environment: using eclipse 3.2.2
> JDK 1.5
> hibernate tools 3.2beta9
> h2 database ver 1.0
>            Reporter: Hashim Kubba
>            Priority: Minor
>
> I'm adding meta attributes in reveng.xml (HBX-575) for customization of the resulting Java code from a reverse engineered database. yet I would really like to be able to add a general class-description to all my classes ( say @ Auther or @version ) , even better; I want all my classes to extend BasicDataObject where I can add some static final constants to use, but now I have to add that to each table 
> <hibernate-reverse-engineering>
> 	<table name="FOO">
> 		<meta attribute="extends">BasicDataObject</meta>
>        </table name>
> 	<table name="BOO">
> 		<meta attribute="extends">BasicDataObject</meta>
>        </table name>
>         ...
> </hibernate-reverse-engineering>
> What I would like to see is something like
> <hibernate-reverse-engineering>
> 	<meta attribute="extends">BasicDataObject</meta>
> </hibernate-reverse-engineering>
> and that will make all my classes extend BasicDataObject; metas that can be used directly under hibernate-reverse-engineering are:
> * class-description	general comment for all classes
> * implements		   implements a common interface with constants	
> * extends		       extends a common class with constants and common methods
> * scope-class		   make all classes protected	
> * scope-set		     all sets in all classes
> * scope-get		     all gets in all classes
> A nice to have will be:
> * generated-class-suffix
> * generated-class-prefix
> or <meta name="generated-class" suffix="suffix" prefix="prefix" />
> that will allow me to control all the classes names

-- 
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