HHH-3570: renaming versioned to audited

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@15459 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Adam Warski 2008-10-31 11:42:38 +00:00
parent 644ea8d2f2
commit 90f70231c6
109 changed files with 310 additions and 318 deletions

View File

@ -34,7 +34,7 @@ import javax.persistence.JoinColumn;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD})
public @interface VersionsJoinTable {
public @interface AuditJoinTable {
/**
* @return Name of the join table. Defaults to a concatenation of the names of the primary table of the entity
* owning the association and of the primary table of the entity referenced by the association.

View File

@ -33,7 +33,7 @@ import org.hibernate.envers.query.VersionsQueryCreator;
/**
* @author Adam Warski (adam at warski dot org)
*/
public interface VersionsReader {
public interface AuditReader {
/**
* Find an entity by primary key at the given revision.
* @param cls Class of the entity.

View File

@ -38,19 +38,19 @@ import org.hibernate.event.PostInsertEventListener;
/**
* @author Adam Warski (adam at warski dot org)
*/
public class VersionsReaderFactory {
private VersionsReaderFactory() { }
public class AuditReaderFactory {
private AuditReaderFactory() { }
/**
* Create a versions reader associated with an open session.
* <b>WARNING:</b> Using Envers with Hibernate (not with Hibernate Entity Manager/JPA) is experimental,
* if possible, use {@link org.hibernate.envers.VersionsReaderFactory#get(javax.persistence.EntityManager)}.
* if possible, use {@link AuditReaderFactory#get(javax.persistence.EntityManager)}.
* @param session An open session.
* @return A versions reader associated with the given sesison. It shouldn't be used
* after the session is closed.
* @throws VersionsException When the given required listeners aren't installed.
*/
public static VersionsReader get(Session session) throws VersionsException {
public static AuditReader get(Session session) throws VersionsException {
SessionImplementor sessionImpl = (SessionImplementor) session;
EventListeners listeners = sessionImpl.getListeners();
@ -77,7 +77,7 @@ public class VersionsReaderFactory {
* @throws VersionsException When the given entity manager is not based on Hibernate, or if the required
* listeners aren't installed.
*/
public static VersionsReader get(EntityManager entityManager) throws VersionsException {
public static AuditReader get(EntityManager entityManager) throws VersionsException {
if (entityManager.getDelegate() instanceof Session) {
return get((Session) entityManager.getDelegate());
}

View File

@ -33,7 +33,7 @@ import java.lang.annotation.Target;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface VersionsTable {
public @interface AuditTable {
String value();
/**

View File

@ -35,6 +35,6 @@ import java.lang.annotation.Target;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
public @interface Versioned {
public @interface Audited {
ModificationStore modStore() default ModificationStore.FULL;
}

View File

@ -34,6 +34,6 @@ import java.lang.annotation.Target;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.FIELD})
public @interface Unversioned {
public @interface NotAudited {
}

View File

@ -33,7 +33,7 @@ import java.lang.annotation.Target;
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface SecondaryVersionsTable {
public @interface SecondaryAuditTable {
String secondaryTableName();
String secondaryVersionsTableName();

View File

@ -33,6 +33,6 @@ import java.lang.annotation.Target;
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface SecondaryVersionsTables {
SecondaryVersionsTable[] value();
public @interface SecondaryAuditTables {
SecondaryAuditTable[] value();
}

View File

@ -28,12 +28,8 @@ import java.util.Iterator;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.hibernate.envers.DefaultRevisionEntity;
import org.hibernate.envers.RevisionEntity;
import org.hibernate.envers.RevisionListener;
import org.hibernate.envers.RevisionNumber;
import org.hibernate.envers.RevisionTimestamp;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.*;
import org.hibernate.envers.configuration.metadata.MetadataTools;
import org.hibernate.envers.revisioninfo.DefaultRevisionInfoGenerator;
import org.hibernate.envers.revisioninfo.RevisionInfoGenerator;
@ -181,7 +177,7 @@ public class RevisionInfoConfiguration {
}
// Checking if custom revision entity isn't versioned
if (clazz.getAnnotation(Versioned.class) != null) {
if (clazz.getAnnotation(Audited.class) != null) {
throw new MappingException("An entity annotated with @RevisionEntity cannot be versioned!");
}

View File

@ -27,12 +27,8 @@ import java.lang.annotation.Annotation;
import javax.persistence.MapKey;
import javax.persistence.Version;
import org.hibernate.envers.SecondaryVersionsTable;
import org.hibernate.envers.SecondaryVersionsTables;
import org.hibernate.envers.Unversioned;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.VersionsJoinTable;
import org.hibernate.envers.VersionsTable;
import org.hibernate.envers.SecondaryAuditTable;
import org.hibernate.envers.*;
import org.hibernate.envers.configuration.GlobalConfiguration;
import org.hibernate.envers.tools.reflection.YClass;
import org.hibernate.envers.tools.reflection.YProperty;
@ -67,7 +63,7 @@ public final class AnnotationsMetadataReader {
}
private void addPropertyVersioned(YProperty property) {
Versioned ver = property.getAnnotation(Versioned.class);
Audited ver = property.getAnnotation(Audited.class);
if (ver != null) {
versioningData.propertyStoreInfo.propertyStores.put(property.getName(), ver.modStore());
}
@ -83,7 +79,7 @@ public final class AnnotationsMetadataReader {
private void addPropertyUnversioned(YProperty property) {
// check if a property is declared as unversioned to exclude it
// useful if a class is versioned but some properties should be excluded
Unversioned unVer = property.getAnnotation(Unversioned.class);
NotAudited unVer = property.getAnnotation(NotAudited.class);
if (unVer != null) {
versioningData.unversionedProperties.add(property.getName());
} else {
@ -99,7 +95,7 @@ public final class AnnotationsMetadataReader {
}
private void addPropertyJoinTables(YProperty property) {
VersionsJoinTable joinTable = property.getAnnotation(VersionsJoinTable.class);
AuditJoinTable joinTable = property.getAnnotation(AuditJoinTable.class);
if (joinTable != null) {
versioningData.versionsJoinTables.put(property.getName(), joinTable);
}
@ -125,7 +121,7 @@ public final class AnnotationsMetadataReader {
}
private void addDefaultVersioned(YClass clazz) {
Versioned defaultVersioned = clazz.getAnnotation(Versioned.class);
Audited defaultVersioned = clazz.getAnnotation(Audited.class);
if (defaultVersioned != null) {
versioningData.propertyStoreInfo.defaultStore = defaultVersioned.modStore();
@ -133,7 +129,7 @@ public final class AnnotationsMetadataReader {
}
private void addVersionsTable(YClass clazz) {
VersionsTable versionsTable = clazz.getAnnotation(VersionsTable.class);
AuditTable versionsTable = clazz.getAnnotation(AuditTable.class);
if (versionsTable != null) {
versioningData.versionsTable = versionsTable;
} else {
@ -143,15 +139,15 @@ public final class AnnotationsMetadataReader {
private void addVersionsSecondaryTables(YClass clazz) {
// Getting information on secondary tables
SecondaryVersionsTable secondaryVersionsTable1 = clazz.getAnnotation(SecondaryVersionsTable.class);
SecondaryAuditTable secondaryVersionsTable1 = clazz.getAnnotation(SecondaryAuditTable.class);
if (secondaryVersionsTable1 != null) {
versioningData.secondaryTableDictionary.put(secondaryVersionsTable1.secondaryTableName(),
secondaryVersionsTable1.secondaryVersionsTableName());
}
SecondaryVersionsTables secondaryVersionsTables = clazz.getAnnotation(SecondaryVersionsTables.class);
SecondaryAuditTables secondaryVersionsTables = clazz.getAnnotation(SecondaryAuditTables.class);
if (secondaryVersionsTables != null) {
for (SecondaryVersionsTable secondaryVersionsTable2 : secondaryVersionsTables.value()) {
for (SecondaryAuditTable secondaryVersionsTable2 : secondaryVersionsTables.value()) {
versioningData.secondaryTableDictionary.put(secondaryVersionsTable2.secondaryTableName(),
secondaryVersionsTable2.secondaryVersionsTableName());
}
@ -177,8 +173,8 @@ public final class AnnotationsMetadataReader {
return versioningData;
}
private VersionsTable getDefaultVersionsTable() {
return new VersionsTable() {
private AuditTable getDefaultVersionsTable() {
return new AuditTable() {
public String value() { return ""; }
public String schema() { return ""; }
public String catalog() { return ""; }

View File

@ -37,7 +37,7 @@ import javax.persistence.JoinColumn;
import org.dom4j.Element;
import org.hibernate.envers.ModificationStore;
import org.hibernate.envers.VersionsJoinTable;
import org.hibernate.envers.AuditJoinTable;
import org.hibernate.envers.entities.EntityConfiguration;
import org.hibernate.envers.entities.IdMappingData;
import org.hibernate.envers.entities.mapper.CompositeMapperBuilder;
@ -91,7 +91,7 @@ public final class CollectionMetadataGenerator {
private final CompositeMapperBuilder currentMapper;
private final String referencingEntityName;
private final EntityXmlMappingData xmlMappingData;
private final VersionsJoinTable joinTable;
private final AuditJoinTable joinTable;
private final String mapKey;
private final EntityConfiguration referencingEntityConfiguration;
@ -116,7 +116,7 @@ public final class CollectionMetadataGenerator {
public CollectionMetadataGenerator(VersionsMetadataGenerator mainGenerator, String propertyName,
Collection propertyValue, CompositeMapperBuilder currentMapper,
String referencingEntityName, EntityXmlMappingData xmlMappingData,
VersionsJoinTable joinTable, String mapKey) {
AuditJoinTable joinTable, String mapKey) {
this.mainGenerator = mainGenerator;
this.propertyName = propertyName;
this.propertyValue = propertyValue;
@ -474,8 +474,8 @@ public final class CollectionMetadataGenerator {
return middleEntityXmlId;
}
private VersionsJoinTable getDefaultVersionsJoinTable() {
return new VersionsJoinTable() {
private AuditJoinTable getDefaultVersionsJoinTable() {
return new AuditJoinTable() {
public String name() { return ""; }
public String schema() { return ""; }
public String catalog() { return ""; }

View File

@ -29,8 +29,8 @@ import java.util.List;
import java.util.Map;
import org.hibernate.envers.ModificationStore;
import org.hibernate.envers.VersionsJoinTable;
import org.hibernate.envers.VersionsTable;
import org.hibernate.envers.AuditJoinTable;
import org.hibernate.envers.AuditTable;
/**
* @author Adam Warski (adam at warski dot org)
@ -41,18 +41,18 @@ public class PersistentClassVersioningData {
propertyStoreInfo = new PropertyStoreInfo(new HashMap<String, ModificationStore>());
secondaryTableDictionary = new HashMap<String, String>();
unversionedProperties = new ArrayList<String>();
versionsJoinTables = new HashMap<String, VersionsJoinTable>();
versionsJoinTables = new HashMap<String, AuditJoinTable>();
mapKeys = new HashMap<String, String>();
}
public PropertyStoreInfo propertyStoreInfo;
public VersionsTable versionsTable;
public AuditTable versionsTable;
public Map<String, String> secondaryTableDictionary;
public List<String> unversionedProperties;
/**
* A map from property names to custom join tables definitions.
*/
public Map<String, VersionsJoinTable> versionsJoinTables;
public Map<String, AuditJoinTable> versionsJoinTables;
/**
* A map from property names to the value of the related property names in a map key annotation. An empty string,
* if the property name is not specified in the mapkey annotation.

View File

@ -30,7 +30,7 @@ import java.util.Map;
import org.dom4j.Element;
import org.hibernate.envers.ModificationStore;
import org.hibernate.envers.VersionsJoinTable;
import org.hibernate.envers.AuditJoinTable;
import org.hibernate.envers.configuration.GlobalConfiguration;
import org.hibernate.envers.configuration.VersionsEntitiesConfiguration;
import org.hibernate.envers.entities.EntityConfiguration;
@ -132,7 +132,7 @@ public final class VersionsMetadataGenerator {
@SuppressWarnings({"unchecked"})
void addValue(Element parent, String name, Value value, CompositeMapperBuilder currentMapper,
ModificationStore store, String entityName, EntityXmlMappingData xmlMappingData,
VersionsJoinTable joinTable, String mapKey, boolean insertable, boolean firstPass) {
AuditJoinTable joinTable, String mapKey, boolean insertable, boolean firstPass) {
Type type = value.getType();
// only first pass

View File

@ -23,7 +23,7 @@
*/
package org.hibernate.envers.reader;
import org.hibernate.envers.VersionsReader;
import org.hibernate.envers.AuditReader;
import org.hibernate.Session;
import org.hibernate.engine.SessionImplementor;
@ -32,7 +32,7 @@ import org.hibernate.engine.SessionImplementor;
* An interface exposed by a VersionsReader to library-facing classes.
* @author Adam Warski (adam at warski dot org)
*/
public interface VersionsReaderImplementor extends VersionsReader {
public interface VersionsReaderImplementor extends AuditReader {
SessionImplementor getSessionImplementor();
Session getSession();
FirstLevelCache getFirstLevelCache();

View File

@ -27,8 +27,8 @@ import java.io.IOException;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import org.hibernate.envers.VersionsReader;
import org.hibernate.envers.VersionsReaderFactory;
import org.hibernate.envers.AuditReader;
import org.hibernate.envers.AuditReaderFactory;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
@ -40,7 +40,7 @@ import org.hibernate.ejb.Ejb3Configuration;
public abstract class AbstractEntityTest {
private EntityManagerFactory emf;
private EntityManager entityManager;
private VersionsReader versionsReader;
private AuditReader versionsReader;
private Ejb3Configuration cfg;
public abstract void configure(Ejb3Configuration cfg);
@ -52,7 +52,7 @@ public abstract class AbstractEntityTest {
}
entityManager = emf.createEntityManager();
versionsReader = VersionsReaderFactory.get(entityManager);
versionsReader = AuditReaderFactory.get(entityManager);
}
@BeforeClass
@ -69,7 +69,7 @@ public abstract class AbstractEntityTest {
return entityManager;
}
public VersionsReader getVersionsReader() {
public AuditReader getVersionsReader() {
return versionsReader;
}

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -38,7 +38,7 @@ public class IntTestEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
private Integer number;
public IntTestEntity() {

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -38,10 +38,10 @@ public class StrIntTestEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
private String str1;
@Versioned
@Audited
private Integer number;
public StrIntTestEntity() {

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -38,7 +38,7 @@ public class StrTestEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
private String str;
public StrTestEntity() {

View File

@ -28,14 +28,14 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Unversioned;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.NotAudited;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
*/
@Entity
@Versioned
@Audited
public class UnversionedEntity {
@Id
@GeneratedValue
@ -45,7 +45,7 @@ public class UnversionedEntity {
private String data1;
@Basic
@Unversioned
@NotAudited
private String data2;
public UnversionedEntity() {

View File

@ -31,7 +31,7 @@ import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.annotations.CollectionOfElements;
@ -47,12 +47,12 @@ public class EnumSetEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
@CollectionOfElements
@Enumerated(EnumType.STRING)
private Set<E1> enums1;
@Versioned
@Audited
@CollectionOfElements
@Enumerated(EnumType.ORDINAL)
private Set<E2> enums2;

View File

@ -29,7 +29,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.annotations.CollectionOfElements;
import org.hibernate.annotations.IndexColumn;
@ -43,7 +43,7 @@ public class StringListEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
@CollectionOfElements
@IndexColumn(name = "list_index")
private List<String> strings;

View File

@ -29,7 +29,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.annotations.CollectionOfElements;
@ -42,7 +42,7 @@ public class StringMapEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
@CollectionOfElements
private Map<String, String> strings;

View File

@ -29,7 +29,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.annotations.CollectionOfElements;
@ -42,7 +42,7 @@ public class StringSetEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
@CollectionOfElements
private Set<String> strings;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -40,7 +40,7 @@ public class ComponentTestEntity {
private Integer id;
@Embedded
@Versioned
@Audited
private Component1 comp1;
@Embedded

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.annotations.Columns;
import org.hibernate.annotations.Type;
@ -44,7 +44,7 @@ public class CompositeCustomTypeEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
@Type(type = "comp")
@Columns(columns = { @Column(name = "str"), @Column(name = "num") })
private Component component;

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;
@ -44,7 +44,7 @@ public class ParametrizedCustomTypeEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
@Type(type = "param")
private String str;

View File

@ -26,7 +26,7 @@ package org.hibernate.envers.test.entities.ids;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -36,7 +36,7 @@ public class EmbIdTestEntity {
@EmbeddedId
private EmbId id;
@Versioned
@Audited
private String str1;
public EmbIdTestEntity() {

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -41,7 +41,7 @@ public class MulIdTestEntity {
@Id
private Integer id2;
@Versioned
@Audited
private String str1;
public MulIdTestEntity() {

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* Many-to-many not-owning entity
@ -39,10 +39,10 @@ public class ListOwnedEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToMany(mappedBy="references")
private List<ListOwningEntity> referencing;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* Entity owning the many-to-many relation
@ -39,10 +39,10 @@ public class ListOwningEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToMany
private List<ListOwnedEntity> references;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* Many-to-many not-owning entity
@ -39,10 +39,10 @@ public class MapOwnedEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToMany(mappedBy="references")
private Set<MapOwningEntity> referencing;

View File

@ -29,7 +29,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* Entity owning the many-to-many relation
@ -40,10 +40,10 @@ public class MapOwningEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToMany
private Map<String, MapOwnedEntity> references = new HashMap<String, MapOwnedEntity>();

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* Many-to-many not-owning entity
@ -39,10 +39,10 @@ public class SetOwnedEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToMany(mappedBy="references")
private Set<SetOwningEntity> referencing;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* Entity owning the many-to-many relation
@ -39,10 +39,10 @@ public class SetOwningEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToMany
private Set<SetOwnedEntity> references;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.StrTestEntity;
/**
@ -40,10 +40,10 @@ public class ListUniEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToMany
private List<StrTestEntity> references;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.StrTestEntity;
/**
@ -40,10 +40,10 @@ public class MapUniEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToMany
private Map<String, StrTestEntity> map;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.StrTestEntity;
/**
@ -40,10 +40,10 @@ public class SetUniEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToMany
private Set<StrTestEntity> references;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencEd entity
@ -39,10 +39,10 @@ public class CollectionRefEdEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany(mappedBy="reference")
private Collection<CollectionRefIngEntity> reffering;

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencIng entity
@ -38,10 +38,10 @@ public class CollectionRefIngEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToOne
private CollectionRefEdEntity reference;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencEd entity
@ -39,10 +39,10 @@ public class ListRefEdEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany(mappedBy="reference")
private List<ListRefIngEntity> reffering;

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencIng entity
@ -38,10 +38,10 @@ public class ListRefIngEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToOne
private ListRefEdEntity reference;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencEd entity
@ -39,10 +39,10 @@ public class SetRefEdEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany(mappedBy="reference")
private Set<SetRefIngEntity> reffering;

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencIng entity
@ -38,10 +38,10 @@ public class SetRefIngEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToOne
private SetRefEdEntity reference;

View File

@ -29,7 +29,7 @@ import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.StrTestEntity;
/**
@ -41,15 +41,15 @@ public class DoubleSetRefCollEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany
@JoinTable(name = "DOUBLE_STR_1")
private Set<StrTestEntity> collection;
@Versioned
@Audited
@OneToMany
@JoinTable(name = "DOUBLE_STR_2")
private Set<StrTestEntity> collection2;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.StrTestEntity;
/**
@ -40,10 +40,10 @@ public class ListRefCollEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany
private List<StrTestEntity> collection;

View File

@ -29,7 +29,7 @@ import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.StrTestEntity;
/**
@ -41,10 +41,10 @@ public class SetJoinColumnRefCollEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany
@JoinColumn(name = "SJCR_ID")
private Set<StrTestEntity> collection;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.StrTestEntity;
/**
@ -40,10 +40,10 @@ public class SetRefCollEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany
private Set<StrTestEntity> collection;

View File

@ -28,7 +28,7 @@ import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.ids.EmbId;
import org.hibernate.envers.test.entities.ids.EmbIdTestEntity;
@ -41,10 +41,10 @@ public class SetRefCollEntityEmbId {
@EmbeddedId
private EmbId id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany
private Set<EmbIdTestEntity> collection;

View File

@ -29,7 +29,7 @@ import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.ids.MulId;
import org.hibernate.envers.test.entities.ids.MulIdTestEntity;
@ -46,10 +46,10 @@ public class SetRefCollEntityMulId {
@Id
private Integer id2;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany
private Set<MulIdTestEntity> collection;

View File

@ -28,7 +28,7 @@ import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.ids.EmbId;
/**
@ -40,10 +40,10 @@ public class SetRefEdEmbIdEntity {
@EmbeddedId
private EmbId id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany(mappedBy="reference")
private Set<SetRefIngEmbIdEntity> reffering;

View File

@ -29,7 +29,7 @@ import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.ids.MulId;
/**
@ -45,10 +45,10 @@ public class SetRefEdMulIdEntity {
@Id
private Integer id2;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany(mappedBy="reference")
private Set<SetRefIngMulIdEntity> reffering;

View File

@ -27,7 +27,7 @@ import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.ids.EmbId;
/**
@ -39,10 +39,10 @@ public class SetRefIngEmbIdEntity {
@EmbeddedId
private EmbId id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToOne
private SetRefEdEmbIdEntity reference;

View File

@ -28,7 +28,7 @@ import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.ManyToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.ids.MulId;
/**
@ -44,10 +44,10 @@ public class SetRefIngMulIdEntity {
@Id
private Integer id2;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToOne
private SetRefEdMulIdEntity reference;

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -38,10 +38,10 @@ public class BasicTestEntity1 {
@GeneratedValue
private Integer id;
@Versioned
@Audited
private String str1;
@Versioned
@Audited
private long long1;
public BasicTestEntity1() {

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -38,7 +38,7 @@ public class BasicTestEntity2 {
@GeneratedValue
private Integer id;
@Versioned
@Audited
private String str1;
private String str2;

View File

@ -27,13 +27,13 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
*/
@Entity
@Versioned
@Audited
public class BasicTestEntity4 {
@Id
@GeneratedValue

View File

@ -31,7 +31,7 @@ import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.MapKey;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.components.Component1;
import org.hibernate.envers.test.entities.components.ComponentTestEntity;
@ -44,7 +44,7 @@ public class ComponentMapKeyEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
@ManyToMany
@MapKey(name = "comp1")
private Map<Component1, ComponentTestEntity> idmap;

View File

@ -31,7 +31,7 @@ import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.MapKey;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.StrTestEntity;
/**
@ -43,7 +43,7 @@ public class IdMapKeyEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
@ManyToMany
@MapKey
private Map<Integer, StrTestEntity> idmap;

View File

@ -28,7 +28,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -39,7 +39,7 @@ public class DateTestEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
private Date date;
public DateTestEntity() {

View File

@ -29,13 +29,13 @@ import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
*/
@Entity
@Versioned
@Audited
public class EnumTestEntity {
@Id
@GeneratedValue

View File

@ -29,7 +29,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -41,15 +41,15 @@ public class LobTestEntity {
private Integer id;
@Lob
@Versioned
@Audited
private String stringLob;
@Lob
@Versioned
@Audited
private byte[] byteLob;
@Lob
@Versioned
@Audited
private char[] charLob;
public LobTestEntity() {

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -38,7 +38,7 @@ public class SerializableTestEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
private SerObject obj;
public SerializableTestEntity() {

View File

@ -27,14 +27,14 @@ import javax.persistence.Basic;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
*/
@Entity
@DiscriminatorValue("2")
@Versioned
@Audited
public class ChildEntity extends ParentEntity {
@Basic
private Long number;

View File

@ -33,7 +33,7 @@ import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -42,7 +42,7 @@ import org.hibernate.envers.Versioned;
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "discriminator", discriminatorType = DiscriminatorType.INTEGER)
@DiscriminatorValue("1")
@Versioned
@Audited
public class ParentEntity {
@Id
@GeneratedValue

View File

@ -28,14 +28,14 @@ import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
*/
@Entity
@DiscriminatorValue("2")
@Versioned
@Audited
public class ChildIngEntity extends ParentNotIngEntity {
@Basic
private Long number;

View File

@ -33,7 +33,7 @@ import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -42,7 +42,7 @@ import org.hibernate.envers.Versioned;
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "discriminator", discriminatorType = DiscriminatorType.INTEGER)
@DiscriminatorValue("1")
@Versioned
@Audited
public class ParentNotIngEntity {
@Id
@GeneratedValue

View File

@ -29,13 +29,13 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
*/
@Entity
@Versioned
@Audited
public class ReferencedEntity {
@Id
@GeneratedValue

View File

@ -27,14 +27,14 @@ import javax.persistence.Basic;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
*/
@Entity
@DiscriminatorValue("2")
@Versioned
@Audited
public class ChildIngEntity extends ParentIngEntity {
@Basic
private Long number;

View File

@ -34,7 +34,7 @@ import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -43,7 +43,7 @@ import org.hibernate.envers.Versioned;
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "discriminator", discriminatorType = DiscriminatorType.INTEGER)
@DiscriminatorValue("1")
@Versioned
@Audited
public class ParentIngEntity {
@Id
@GeneratedValue

View File

@ -29,13 +29,13 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
*/
@Entity
@Versioned
@Audited
public class ReferencedEntity {
@Id
@GeneratedValue

View File

@ -30,7 +30,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.IntTestEntity;
import org.hibernate.envers.test.entities.StrTestEntity;
@ -45,7 +45,7 @@ public class TernaryMapEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
@ManyToMany
@MapKeyManyToMany
private Map<IntTestEntity, StrTestEntity> map;

View File

@ -30,7 +30,7 @@ import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.StrTestEntity;
/**
@ -41,10 +41,10 @@ public class DetachedNamingTestEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany
@JoinTable(name = "UNI_NAMING_TEST",
joinColumns = @JoinColumn(name = "ID_1"),

View File

@ -30,7 +30,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencEd entity
@ -43,10 +43,10 @@ public class JoinNamingRefEdEntity {
@Column(name = "jnree_id")
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany(mappedBy="reference")
private List<JoinNamingRefIngEntity> reffering;

View File

@ -30,7 +30,7 @@ import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencIng entity
@ -43,10 +43,10 @@ public class JoinNamingRefIngEntity {
@Column(name = "jnrie_id")
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToOne
@JoinColumn(name = "jnree_column_reference")
private JoinNamingRefEdEntity reference;

View File

@ -29,15 +29,15 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.VersionsTable;
import org.hibernate.envers.Audited;
import org.hibernate.envers.AuditTable;
/**
* @author Adam Warski (adam at warski dot org)
*/
@Entity
@Table(name="naming_test_entity_1")
@VersionsTable("naming_test_entity_1_versions")
@AuditTable("naming_test_entity_1_versions")
public class NamingTestEntity1 {
@Id
@GeneratedValue
@ -45,7 +45,7 @@ public class NamingTestEntity1 {
private Integer id;
@Column(name = "nte_data")
@Versioned
@Audited
private String data;
public NamingTestEntity1() {

View File

@ -29,8 +29,8 @@ import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.VersionsJoinTable;
import org.hibernate.envers.Audited;
import org.hibernate.envers.AuditJoinTable;
import org.hibernate.envers.test.entities.StrTestEntity;
/**
@ -41,13 +41,13 @@ public class VersionsJoinTableTestEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany
@JoinColumn(name = "VJT_ID")
@VersionsJoinTable(name = "VERSIONS_JOIN_TABLE_TEST", inverseJoinColumns = @JoinColumn(name = "STR_ID"))
@AuditJoinTable(name = "VERSIONS_JOIN_TABLE_TEST", inverseJoinColumns = @JoinColumn(name = "STR_ID"))
private Set<StrTestEntity> collection;
public VersionsJoinTableTestEntity() {

View File

@ -29,7 +29,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencEd entity
@ -41,10 +41,10 @@ public class JoinEmbIdNamingRefEdEntity {
@GeneratedValue
private EmbIdNaming id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany(mappedBy="reference")
private List<JoinEmbIdNamingRefIngEntity> reffering;

View File

@ -30,7 +30,7 @@ import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencIng entity
@ -42,10 +42,10 @@ public class JoinEmbIdNamingRefIngEntity {
@GeneratedValue
private EmbIdNaming id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToOne
@JoinColumns({@JoinColumn(name = "XX_reference", referencedColumnName = "XX"),
@JoinColumn(name = "YY_reference", referencedColumnName = "YY")})

View File

@ -29,7 +29,7 @@ import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencEd entity
@ -44,10 +44,10 @@ public class JoinMulIdNamingRefEdEntity {
@Id
private Integer id2;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToMany(mappedBy="reference")
private List<JoinMulIdNamingRefIngEntity> reffering;

View File

@ -30,7 +30,7 @@ import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* ReferencIng entity
@ -45,10 +45,10 @@ public class JoinMulIdNamingRefIngEntity {
@Id
private Integer id2;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@ManyToOne
@JoinColumns({@JoinColumn(name = "ID2_reference", referencedColumnName = "ID_2"),
@JoinColumn(name = "ID1_reference", referencedColumnName = "ID_1")})

View File

@ -28,13 +28,13 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
*/
@Entity
@Versioned
@Audited
public class NotInsertableTestEntity {
@Id
@GeneratedValue

View File

@ -31,7 +31,7 @@ import javax.persistence.Id;
import javax.persistence.MapKey;
import javax.persistence.OneToMany;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -42,7 +42,7 @@ public class RefEdMapKeyEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
@OneToMany(mappedBy="reference")
@MapKey(name = "data")
private Map<String, RefIngMapKeyEntity> idmap;

View File

@ -28,7 +28,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -39,11 +39,11 @@ public class RefIngMapKeyEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
@ManyToOne
private RefEdMapKeyEntity reference;
@Versioned
@Audited
private String data;
public Integer getId() {

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -37,10 +37,10 @@ public class BiRefEdEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToOne(mappedBy="reference")
private BiRefIngEntity referencing;

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -37,10 +37,10 @@ public class BiRefIngEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToOne
private BiRefEdEntity reference;

View File

@ -27,7 +27,7 @@ import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.ids.EmbId;
/**
@ -38,10 +38,10 @@ public class BiEmbIdRefEdEntity {
@EmbeddedId
private EmbId id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToOne(mappedBy="reference")
private BiEmbIdRefIngEntity referencing;

View File

@ -27,7 +27,7 @@ import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.ids.EmbId;
/**
@ -38,10 +38,10 @@ public class BiEmbIdRefIngEntity {
@EmbeddedId
private EmbId id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToOne
private BiEmbIdRefEdEntity reference;

View File

@ -28,7 +28,7 @@ import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.OneToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.ids.MulId;
/**
@ -43,10 +43,10 @@ public class BiMulIdRefEdEntity {
@Id
private Integer id2;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToOne(mappedBy="reference")
private BiMulIdRefIngEntity referencing;

View File

@ -28,7 +28,7 @@ import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.OneToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.entities.ids.MulId;
/**
@ -43,10 +43,10 @@ public class BiMulIdRefIngEntity {
@Id
private Integer id2;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToOne
private BiMulIdRefEdEntity reference;

View File

@ -26,7 +26,7 @@ package org.hibernate.envers.test.integration.onetoone.unidirectional;
import javax.persistence.Entity;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* Unidirectional ReferencEd Entity
@ -37,7 +37,7 @@ public class UniRefEdEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
public UniRefEdEntity() {

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* Unidirectional ReferencIng Entity
@ -38,10 +38,10 @@ public class UniRefIngEntity {
@Id
private Integer id;
@Versioned
@Audited
private String data;
@Versioned
@Audited
@OneToOne
private UniRefEdEntity reference;

View File

@ -27,7 +27,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Adam Warski (adam at warski dot org)
@ -38,7 +38,7 @@ public class PropertiesTestEntity {
@GeneratedValue
private Integer id;
@Versioned
@Audited
private String str;
public PropertiesTestEntity() {

View File

@ -28,12 +28,12 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Version;
import org.hibernate.envers.Versioned;
import org.hibernate.envers.Audited;
/**
* @author Nicolas Doroskevich
*/
@Versioned
@Audited
@Entity
public class UnversionedOptimisticLockingFieldEntity {

View File

@ -27,7 +27,7 @@ import java.util.Arrays;
import java.util.Date;
import javax.persistence.EntityManager;
import org.hibernate.envers.VersionsReader;
import org.hibernate.envers.AuditReader;
import org.hibernate.envers.exception.RevisionDoesNotExistException;
import org.hibernate.envers.test.AbstractEntityTest;
import org.hibernate.envers.test.entities.StrTestEntity;
@ -91,14 +91,14 @@ public class Custom extends AbstractEntityTest {
@Test
public void testDatesForRevisions() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@ -108,7 +108,7 @@ public class Custom extends AbstractEntityTest {
@Test
public void testFindRevision() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
long rev1Timestamp = vr.findRevision(CustomRevEntity.class, 1).getCustomTimestamp();
assert rev1Timestamp > timestamp1;

View File

@ -27,7 +27,7 @@ import java.util.Arrays;
import java.util.Date;
import javax.persistence.EntityManager;
import org.hibernate.envers.VersionsReader;
import org.hibernate.envers.AuditReader;
import org.hibernate.envers.exception.RevisionDoesNotExistException;
import org.hibernate.envers.test.AbstractEntityTest;
import org.hibernate.envers.test.entities.StrTestEntity;
@ -90,14 +90,14 @@ public class CustomBoxed extends AbstractEntityTest {
@Test
public void testDatesForRevisions() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@ -107,7 +107,7 @@ public class CustomBoxed extends AbstractEntityTest {
@Test
public void testFindRevision() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
long rev1Timestamp = vr.findRevision(CustomBoxedRevEntity.class, 1).getCustomTimestamp();
assert rev1Timestamp > timestamp1;

View File

@ -27,7 +27,7 @@ import java.util.Arrays;
import java.util.Date;
import javax.persistence.EntityManager;
import org.hibernate.envers.VersionsReader;
import org.hibernate.envers.AuditReader;
import org.hibernate.envers.exception.RevisionDoesNotExistException;
import org.hibernate.envers.test.AbstractEntityTest;
import org.hibernate.envers.test.entities.StrTestEntity;
@ -91,14 +91,14 @@ public class CustomPropertyAccess extends AbstractEntityTest {
@Test
public void testDatesForRevisions() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@ -108,7 +108,7 @@ public class CustomPropertyAccess extends AbstractEntityTest {
@Test
public void testFindRevision() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
long rev1Timestamp = vr.findRevision(CustomPropertyAccessRevEntity.class, 1).getCustomTimestamp();
assert rev1Timestamp > timestamp1;

View File

@ -27,7 +27,7 @@ import java.util.Arrays;
import java.util.Date;
import javax.persistence.EntityManager;
import org.hibernate.envers.VersionsReader;
import org.hibernate.envers.AuditReader;
import org.hibernate.envers.exception.RevisionDoesNotExistException;
import org.hibernate.envers.test.AbstractEntityTest;
import org.hibernate.envers.test.entities.StrTestEntity;
@ -90,14 +90,14 @@ public class Inherited extends AbstractEntityTest {
@Test
public void testDatesForRevisions() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@ -107,7 +107,7 @@ public class Inherited extends AbstractEntityTest {
@Test
public void testFindRevision() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
long rev1Timestamp = vr.findRevision(InheritedRevEntity.class, 1).getTimestamp();
assert rev1Timestamp > timestamp1;

View File

@ -27,7 +27,7 @@ import java.util.Arrays;
import java.util.Date;
import javax.persistence.EntityManager;
import org.hibernate.envers.VersionsReader;
import org.hibernate.envers.AuditReader;
import org.hibernate.envers.exception.RevisionDoesNotExistException;
import org.hibernate.envers.test.AbstractEntityTest;
import org.hibernate.envers.test.entities.StrTestEntity;
@ -96,14 +96,14 @@ public class Listener extends AbstractEntityTest {
@Test
public void testDatesForRevisions() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
}
@Test
public void testRevisionsForDates() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;
@ -113,7 +113,7 @@ public class Listener extends AbstractEntityTest {
@Test
public void testFindRevision() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
ListenerRevEntity rev1Data = vr.findRevision(ListenerRevEntity.class, 1);
ListenerRevEntity rev2Data = vr.findRevision(ListenerRevEntity.class, 2);

View File

@ -26,7 +26,7 @@ package org.hibernate.envers.test.integration.reventity;
import java.util.Arrays;
import javax.persistence.EntityManager;
import org.hibernate.envers.VersionsReader;
import org.hibernate.envers.AuditReader;
import org.hibernate.envers.test.AbstractEntityTest;
import org.hibernate.envers.test.entities.StrTestEntity;
import org.testng.annotations.BeforeClass;
@ -64,7 +64,7 @@ public class LongRevNumber extends AbstractEntityTest {
@Test
public void testFindRevision() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.findRevision(LongRevNumberRevEntity.class, 1l).getCustomId() == 1l;
assert vr.findRevision(LongRevNumberRevEntity.class, 2l).getCustomId() == 2l;

View File

@ -26,7 +26,7 @@ package org.hibernate.envers.test.integration.revfordate;
import java.util.Date;
import javax.persistence.EntityManager;
import org.hibernate.envers.VersionsReader;
import org.hibernate.envers.AuditReader;
import org.hibernate.envers.exception.RevisionDoesNotExistException;
import org.hibernate.envers.test.AbstractEntityTest;
import org.hibernate.envers.test.entities.StrTestEntity;
@ -99,7 +99,7 @@ public class RevisionForDate extends AbstractEntityTest {
@Test
public void testDatesForRevisions() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionNumberForDate(vr.getRevisionDate(1)).intValue() == 1;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(2)).intValue() == 2;
assert vr.getRevisionNumberForDate(vr.getRevisionDate(3)).intValue() == 3;
@ -107,7 +107,7 @@ public class RevisionForDate extends AbstractEntityTest {
@Test
public void testRevisionsForDates() {
VersionsReader vr = getVersionsReader();
AuditReader vr = getVersionsReader();
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2))).getTime() <= timestamp2;
assert vr.getRevisionDate(vr.getRevisionNumberForDate(new Date(timestamp2)).intValue()+1).getTime() > timestamp2;

Some files were not shown because too many files have changed in this diff Show More