org.nuiton.topia.generator
Class EntityHibernateMappingGenerator

java.lang.Object
  extended by org.nuiton.eugene.Template<M>
      extended by org.nuiton.eugene.AbstractGenerator<org.nuiton.eugene.models.object.ObjectModel>
          extended by org.nuiton.eugene.models.object.ObjectModelGenerator
              extended by org.nuiton.topia.generator.EntityHibernateMappingGenerator
All Implemented Interfaces:
org.nuiton.eugene.TemplateConfiguration

public class EntityHibernateMappingGenerator
extends org.nuiton.eugene.models.object.ObjectModelGenerator

FIXME-poussin-20060102 mettre les attributs node="..." sur tous les attributs

Version:
$Id: EntityHibernateMappingGenerator.java 2205 2011-02-12 11:23:31Z tchemit $
Author:
poussin
Plexus component:
role:
"org.nuiton.eugene.Template"
role-hint:
"org.nuiton.topia.generator.EntityHibernateMappingGenerator"

Field Summary
static String HIBERNATE_ATTRIBUTE_FETCH
           
static String HIBERNATE_ATTRIBUTE_INDEX
           
static String HIBERNATE_ATTRIBUTE_LAZY
           
static String HIBERNATE_ATTRIBUTE_LENGTH
           
static String HIBERNATE_ATTRIBUTE_NOT_NULL
           
static String HIBERNATE_ATTRIBUTE_ORDER_BY
           
static String HIBERNATE_ATTRIBUTE_SCHEMA
           
static String HIBERNATE_ATTRIBUTE_UNIQUE
           
 
Fields inherited from class org.nuiton.eugene.AbstractGenerator
parent
 
Fields inherited from class org.nuiton.eugene.Template
configuration, excludeTemplates, generatedPackages, model
 
Fields inherited from interface org.nuiton.eugene.TemplateConfiguration
PROP_CLASS_LOADER, PROP_DEFAULT_PACKAGE, PROP_ENCODING, PROP_EXCLUDE_TEMPLATES, PROP_GENERATED_PACKAGES, PROP_LAST_MODIFIED_SOURCE, PROP_OVERWRITE, PROP_VERBOSE, PROP_WRITER_REPORT
 
Constructor Summary
EntityHibernateMappingGenerator()
           
 
Method Summary
protected  void generateAttributes(Writer output, org.nuiton.eugene.models.object.ObjectModelClass clazz, List<org.nuiton.eugene.models.object.ObjectModelAttribute> attributes, String prefix)
           
 void generateFromClass(Writer output, org.nuiton.eugene.models.object.ObjectModelClass input)
           
protected  void generateHibernateMany(Writer output, org.nuiton.eugene.models.object.ObjectModelAttribute attr, String prefix)
           
protected  void generateHibernateManyToMany(Writer output, org.nuiton.eugene.models.object.ObjectModelAttribute attr, String prefix)
           
protected  void generateHibernateManyToOne(Writer output, org.nuiton.eugene.models.object.ObjectModelAttribute attr, boolean isUnique, String prefix)
           
protected  void generateHibernateManyToOne(Writer output, org.nuiton.eugene.models.object.ObjectModelAttribute attr, String prefix)
           
protected  void generateHibernateOneToMany(Writer output, org.nuiton.eugene.models.object.ObjectModelAttribute attr, String prefix)
           
protected  void generateHibernateOneToOne(Writer output, org.nuiton.eugene.models.object.ObjectModelAttribute attr, String prefix)
           
protected  void generateHibernateProperty(Writer output, org.nuiton.eugene.models.object.ObjectModelAttribute attr, String prefix)
           
 String getFilenameForClass(org.nuiton.eugene.models.object.ObjectModelClass clazz)
           
protected  String getName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
           
protected  String getName(org.nuiton.eugene.models.object.ObjectModelAttribute attr, boolean isAssoc)
           
protected  String getType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
           
protected  String getType(org.nuiton.eugene.models.object.ObjectModelAttribute attr, boolean isAssoc)
           
 
Methods inherited from class org.nuiton.eugene.models.object.ObjectModelGenerator
applyTemplate, canGenerateElement, generateFromClassifier, generateFromElement, generateFromEnum, generateFromEnumeration, generateFromInterface, generateFromModel, getFilenameForClassifier, getFilenameForEnumeration, getFilenameForInterface, getFilenameForModel, getFilenameForPackage
 
Methods inherited from class org.nuiton.eugene.AbstractGenerator
canGeneratePackage, getDestinationFile, getEncoding, getLastModifiedSource, getProperty, getProperty, getWriter, isNewerThanSource, isOverwrite, setParent, write
 
Methods inherited from class org.nuiton.eugene.Template
getClassLoader, getConfiguration, getExcludeTemplates, getGeneratedPackages, getModel, getOverwrite, getProperties, getWriterReport, isVerbose, setConfiguration, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIBERNATE_ATTRIBUTE_LAZY

public static final String HIBERNATE_ATTRIBUTE_LAZY
See Also:
Constant Field Values

HIBERNATE_ATTRIBUTE_FETCH

public static final String HIBERNATE_ATTRIBUTE_FETCH
See Also:
Constant Field Values

HIBERNATE_ATTRIBUTE_NOT_NULL

public static final String HIBERNATE_ATTRIBUTE_NOT_NULL
See Also:
Constant Field Values

HIBERNATE_ATTRIBUTE_SCHEMA

public static final String HIBERNATE_ATTRIBUTE_SCHEMA
See Also:
Constant Field Values

HIBERNATE_ATTRIBUTE_INDEX

public static final String HIBERNATE_ATTRIBUTE_INDEX
See Also:
Constant Field Values

HIBERNATE_ATTRIBUTE_UNIQUE

public static final String HIBERNATE_ATTRIBUTE_UNIQUE
See Also:
Constant Field Values

HIBERNATE_ATTRIBUTE_LENGTH

public static final String HIBERNATE_ATTRIBUTE_LENGTH
See Also:
Constant Field Values

HIBERNATE_ATTRIBUTE_ORDER_BY

public static final String HIBERNATE_ATTRIBUTE_ORDER_BY
See Also:
Constant Field Values
Constructor Detail

EntityHibernateMappingGenerator

public EntityHibernateMappingGenerator()
Method Detail

getFilenameForClass

public String getFilenameForClass(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Overrides:
getFilenameForClass in class org.nuiton.eugene.models.object.ObjectModelGenerator

generateFromClass

public void generateFromClass(Writer output,
                              org.nuiton.eugene.models.object.ObjectModelClass input)
                       throws IOException
Overrides:
generateFromClass in class org.nuiton.eugene.models.object.ObjectModelGenerator
Throws:
IOException

generateAttributes

protected void generateAttributes(Writer output,
                                  org.nuiton.eugene.models.object.ObjectModelClass clazz,
                                  List<org.nuiton.eugene.models.object.ObjectModelAttribute> attributes,
                                  String prefix)
                           throws IOException
Throws:
IOException

getName

protected String getName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)

getName

protected String getName(org.nuiton.eugene.models.object.ObjectModelAttribute attr,
                         boolean isAssoc)

getType

protected String getType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)

getType

protected String getType(org.nuiton.eugene.models.object.ObjectModelAttribute attr,
                         boolean isAssoc)

generateHibernateProperty

protected void generateHibernateProperty(Writer output,
                                         org.nuiton.eugene.models.object.ObjectModelAttribute attr,
                                         String prefix)
                                  throws IOException
Throws:
IOException

generateHibernateOneToOne

protected void generateHibernateOneToOne(Writer output,
                                         org.nuiton.eugene.models.object.ObjectModelAttribute attr,
                                         String prefix)
                                  throws IOException
Throws:
IOException

generateHibernateOneToMany

protected void generateHibernateOneToMany(Writer output,
                                          org.nuiton.eugene.models.object.ObjectModelAttribute attr,
                                          String prefix)
                                   throws IOException
Throws:
IOException

generateHibernateMany

protected void generateHibernateMany(Writer output,
                                     org.nuiton.eugene.models.object.ObjectModelAttribute attr,
                                     String prefix)
                              throws IOException
Throws:
IOException

generateHibernateManyToOne

protected void generateHibernateManyToOne(Writer output,
                                          org.nuiton.eugene.models.object.ObjectModelAttribute attr,
                                          String prefix)
                                   throws IOException
Throws:
IOException

generateHibernateManyToOne

protected void generateHibernateManyToOne(Writer output,
                                          org.nuiton.eugene.models.object.ObjectModelAttribute attr,
                                          boolean isUnique,
                                          String prefix)
                                   throws IOException
Throws:
IOException

generateHibernateManyToMany

protected void generateHibernateManyToMany(Writer output,
                                           org.nuiton.eugene.models.object.ObjectModelAttribute attr,
                                           String prefix)
                                    throws IOException
Throws:
IOException


Copyright © 2004-2011 CodeLutin. All Rights Reserved.