java - How to generate a customized DAO using hibernate tools -
I would like to generate an optimized DAO that increases the class and implements the sample interface. There is a method in the sample interface, which should be implemented during the formation of the DAO. And naming conventions generated by the DAO should be the DAO in the name of the class, but should not be "HOME", because the Hibernate equipment produces DOO classrooms with DOO classes by default on the home.
My table name is employee, address, pay and I have my organization and they are in the com.mycompany.model package. Currently I have address, employee, salary unit with all annotations and mapping. I want to generate OO, ampleADOo and Saladio by using the reverse engineering strategies below.
Below is my reverse engineering strategy class
public class DAOReverseEngineeringStrategy DelegatingReverseEngineeringStrategy Expands {public DAORverseEngineeringStrategy {ReverseEngineeringStrategy Representative} {Super}; // Tudo Auto-Generated Constructor Stub} @ Override Public Map TomatometAttets (Final Table Identifier Table Identifier) {Map & Lt; String, Meta Attribute & gt; Meta attribute = super .tableToMetaAttributes (tableIdentifier); If (metatellites == empty) {Metatites = new hashmap & lt; String, Metaattibet & gt; (); } Meta attribute feature extends = new meta attribute ("extension"); AttributeExtends.addValue ("ClassA"); Metatieu Contributions ("extended", specialty accents); Meta attribution feature IMPL = new meta attribute ("applicable"); AttributeImpl.addValue ("SampleInterface"); Metatieu Contributions ("equipment", specialty IMPL); Meta attribute feature application = new meta attribute ("additional import"); AttributeImport.addValue ("com.mycompany.ClassA"); AttributeImport.addValue ("com.mycompany.SampleInterface"); AttributeImport.addValue ("com.mycompany.model *."); Metatieu Contribution ("Additional Import", Feature Import); Return meta attributes; }} Thanks.
Definitely it is not open yet, but like sharing my answers in any way is.
I did not do it with the reverse engineering strategy class, but yes, with donor / dowham.ftl (free marker template) files available in the ft.
Comments
Post a Comment