Package net.java.ao.atlassian
Class AtlassianTableNameConverter
java.lang.Object
net.java.ao.atlassian.AtlassianTableNameConverter
- All Implemented Interfaces:
TableNameConverter
This is the table name converter used by the Active Objects plugin. It works according to the following:
- If the
entity interfaceis annotated withTablethen the value of the annotation is used as the base for naming. - Otherwise the
simple class nameis used.
- The base name is transform from camel case to under score and upper case. e.q.
MyEntitybecomesMY_ENTITY. - The
prefixis then applied, using itsprependmethod.
This means that if you refactor your entities and don't want to have to upgrade the database tables used behind
the scene, you can use the Table annotation to your advantage. For example, one could
refactor the following entity:
public interface MyEntity {}
to
@Table("MyEntity")
public interface YourEntity {}
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
AtlassianTableNameConverter
-
-
Method Details
-
getName
Description copied from interface:TableNameConverterGenerates a table name to correspond with the specified class. The algorithm used must check for the existance of theTableannotation and use the appropriate override when necessary. If this check is not made, ActiveObjects will continue to function normally, but any code assuming the proper imlementation of@Tablewill likely fail.- Specified by:
getNamein interfaceTableNameConverter- Parameters:
entityClass- The entity type for which a corresponding field name must be generated.- Returns:
- A database table name which corresponds to the given entity type.
-