Resolving HHH-5588: Improve support for entityNames in envers.

Adding isNotAudited for determine if an entity is marked as @Audited(NOT_AUDITED)
This commit is contained in:
Hernan 2010-11-15 00:14:19 -02:00 committed by adamw
parent eaeb4f8343
commit 7ec8c11327
1 changed files with 9 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import java.util.Map;
/**
* Configuration of the user entities: property mapping of the entities, relations, inheritance.
* @author Adam Warski (adam at warski dot org)
* @author Hernán Chanfreau
*/
public class EntitiesConfigurations {
private Map<String, EntityConfiguration> entitiesConfigurations;
@ -96,6 +97,14 @@ public class EntitiesConfigurations {
return get(entityName) != null;
}
/**
* @param entityName
* @return true if the given entityName is marked audited with relationTargetAuditMode = NOT_AUDITED
*/
public boolean isNotAudited(String entityName) {
return getNotVersionEntityConfiguration(entityName) != null;
}
public RelationDescription getRelationDescription(String entityName, String propertyName) {
EntityConfiguration entCfg = entitiesConfigurations.get(entityName);
RelationDescription relDesc = entCfg.getRelationDescription(propertyName);