HHH-11469 Remove deprecated ModificationStore
This commit is contained in:
parent
e513453aa4
commit
85388ec48f
|
@ -23,13 +23,6 @@ import java.lang.annotation.Target;
|
|||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
|
||||
public @interface Audited {
|
||||
/**
|
||||
* Specifies modification store to use
|
||||
* @deprecated since 5.2, to be removed in 6.0 with no replacement.
|
||||
*/
|
||||
@Deprecated
|
||||
ModificationStore modStore() default ModificationStore.FULL;
|
||||
|
||||
/**
|
||||
* Specifies if the entity that is the target of the relation should be audited or not. If not, then when
|
||||
* reading a historic version an audited entity, the relation will always point to the "current" entity.
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.envers;
|
||||
|
||||
|
||||
/**
|
||||
* @author Adam Warski (adam at warski dot org)
|
||||
* @deprecated since 5.2, to be removed in 6.0 with no replacement.
|
||||
*/
|
||||
@Deprecated
|
||||
public enum ModificationStore {
|
||||
FULL
|
||||
}
|
|
@ -496,7 +496,7 @@ public class RevisionInfoConfiguration {
|
|||
}
|
||||
|
||||
private PropertyData createPropertyData(String name, String accessType) {
|
||||
return new PropertyData( name, name, accessType, null );
|
||||
return new PropertyData( name, name, accessType );
|
||||
}
|
||||
|
||||
private boolean isAnyType(XClass clazz, Class<?>... types) {
|
||||
|
|
|
@ -18,7 +18,6 @@ import java.util.TreeSet;
|
|||
|
||||
import jakarta.persistence.EnumType;
|
||||
|
||||
import org.hibernate.envers.ModificationStore;
|
||||
import org.hibernate.envers.boot.model.Attribute;
|
||||
import org.hibernate.envers.boot.model.AttributeContainer;
|
||||
import org.hibernate.envers.boot.model.BasicAttribute;
|
||||
|
@ -326,7 +325,6 @@ public abstract class AbstractCollectionMetadataGenerator extends AbstractMetada
|
|||
|
||||
new ComponentAuditedPropertiesReader(
|
||||
getMetadataBuildingContext(),
|
||||
ModificationStore.FULL,
|
||||
PersistentPropertiesSource.forComponent( getMetadataBuildingContext(), component ),
|
||||
auditData
|
||||
).read();
|
||||
|
|
|
@ -9,8 +9,6 @@ package org.hibernate.envers.configuration.internal.metadata;
|
|||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.hibernate.envers.ModificationStore;
|
||||
import org.hibernate.envers.RelationTargetAuditMode;
|
||||
import org.hibernate.envers.boot.EnversMappingException;
|
||||
import org.hibernate.envers.boot.model.AttributeContainer;
|
||||
import org.hibernate.envers.boot.model.CompositeIdentifier;
|
||||
|
@ -259,8 +257,7 @@ public final class IdMetadataGenerator extends AbstractMetadataGenerator {
|
|||
return new PropertyData(
|
||||
property.getName(),
|
||||
property.getName(),
|
||||
property.getPropertyAccessorName(),
|
||||
ModificationStore.FULL
|
||||
property.getPropertyAccessorName()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ public class JoinColumnCollectionMetadataGenerator extends AbstractCollectionMet
|
|||
relMapper,
|
||||
// The mapper will only be used to map from entity to map, so no need to provide other details
|
||||
// when constructing the PropertyData.
|
||||
new PropertyData( auditMappedBy, null, null, null ),
|
||||
new PropertyData( auditMappedBy, null, null ),
|
||||
entityName,
|
||||
false,
|
||||
false
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.lang.annotation.Annotation;
|
|||
import org.hibernate.annotations.common.reflection.XClass;
|
||||
import org.hibernate.envers.AuditTable;
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.hibernate.envers.ModificationStore;
|
||||
import org.hibernate.envers.RelationTargetAuditMode;
|
||||
import org.hibernate.envers.SecondaryAuditTable;
|
||||
import org.hibernate.envers.SecondaryAuditTables;
|
||||
import org.hibernate.envers.boot.spi.EnversMetadataBuildingContext;
|
||||
|
@ -31,11 +31,11 @@ public final class AnnotationsMetadataReader {
|
|||
this.metadataBuildingContext = metadataBuildingContext;
|
||||
}
|
||||
|
||||
private ModificationStore getDefaultAudited(XClass clazz) {
|
||||
private RelationTargetAuditMode getDefaultAudited(XClass clazz) {
|
||||
final Audited defaultAudited = clazz.getAnnotation( Audited.class );
|
||||
|
||||
if ( defaultAudited != null ) {
|
||||
return defaultAudited.modStore();
|
||||
return defaultAudited.targetAuditMode();
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
|
@ -77,14 +77,13 @@ public final class AnnotationsMetadataReader {
|
|||
final ClassAuditingData auditData = new ClassAuditingData( persistentClass );
|
||||
final XClass xclass = metadataBuildingContext.getReflectionManager().toXClass( persistentClass.getMappedClass() );
|
||||
|
||||
final ModificationStore defaultStore = getDefaultAudited( xclass );
|
||||
if ( defaultStore != null ) {
|
||||
final RelationTargetAuditMode auditMode = getDefaultAudited( xclass );
|
||||
if ( auditMode != null ) {
|
||||
auditData.setDefaultAudited( true );
|
||||
}
|
||||
|
||||
new AuditedPropertiesReader(
|
||||
metadataBuildingContext,
|
||||
defaultStore,
|
||||
PersistentPropertiesSource.forClass( persistentClass, xclass ),
|
||||
auditData
|
||||
).read();
|
||||
|
|
|
@ -32,7 +32,6 @@ import org.hibernate.envers.AuditMappedBy;
|
|||
import org.hibernate.envers.AuditOverride;
|
||||
import org.hibernate.envers.AuditOverrides;
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.hibernate.envers.ModificationStore;
|
||||
import org.hibernate.envers.NotAudited;
|
||||
import org.hibernate.envers.RelationTargetAuditMode;
|
||||
import org.hibernate.envers.boot.EnversMappingException;
|
||||
|
@ -68,7 +67,6 @@ public class AuditedPropertiesReader {
|
|||
|
||||
public static final String NO_PREFIX = "";
|
||||
|
||||
protected final ModificationStore defaultStore;
|
||||
private final PersistentPropertiesSource persistentPropertiesSource;
|
||||
private final AuditedPropertiesHolder auditedPropertiesHolder;
|
||||
private final EnversMetadataBuildingContext metadataBuildingContext;
|
||||
|
@ -88,19 +86,16 @@ public class AuditedPropertiesReader {
|
|||
|
||||
public AuditedPropertiesReader(
|
||||
EnversMetadataBuildingContext metadataBuildingContext,
|
||||
ModificationStore defaultStore,
|
||||
PersistentPropertiesSource persistentPropertiesSource,
|
||||
AuditedPropertiesHolder auditedPropertiesHolder) {
|
||||
this ( metadataBuildingContext, defaultStore, persistentPropertiesSource, auditedPropertiesHolder, NO_PREFIX );
|
||||
this ( metadataBuildingContext, persistentPropertiesSource, auditedPropertiesHolder, NO_PREFIX );
|
||||
}
|
||||
|
||||
public AuditedPropertiesReader(
|
||||
EnversMetadataBuildingContext metadataBuildingContext,
|
||||
ModificationStore defaultStore,
|
||||
PersistentPropertiesSource persistentPropertiesSource,
|
||||
AuditedPropertiesHolder auditedPropertiesHolder,
|
||||
String propertyNamePrefix) {
|
||||
this.defaultStore = defaultStore;
|
||||
this.persistentPropertiesSource = persistentPropertiesSource;
|
||||
this.auditedPropertiesHolder = auditedPropertiesHolder;
|
||||
this.metadataBuildingContext = metadataBuildingContext;
|
||||
|
@ -441,7 +436,6 @@ public class AuditedPropertiesReader {
|
|||
);
|
||||
final AuditedPropertiesReader audPropReader = new AuditedPropertiesReader(
|
||||
metadataBuildingContext,
|
||||
ModificationStore.FULL,
|
||||
componentPropertiesSource,
|
||||
componentData,
|
||||
propertyNamePrefix + MappingTools.createComponentPrefix( embeddedName )
|
||||
|
@ -471,7 +465,6 @@ public class AuditedPropertiesReader {
|
|||
|
||||
final ComponentAuditedPropertiesReader audPropReader = new ComponentAuditedPropertiesReader(
|
||||
metadataBuildingContext,
|
||||
ModificationStore.FULL,
|
||||
componentPropertiesSource,
|
||||
componentData,
|
||||
propertyNamePrefix + MappingTools.createComponentPrefix( property.getName() )
|
||||
|
@ -596,7 +589,6 @@ public class AuditedPropertiesReader {
|
|||
aud = DEFAULT_AUDITED;
|
||||
}
|
||||
if ( aud != null ) {
|
||||
propertyData.setStore( aud.modStore() );
|
||||
propertyData.setRelationTargetAuditMode( aud.targetAuditMode() );
|
||||
propertyData.setUsingModifiedFlag( checkUsingModifiedFlag( aud ) );
|
||||
propertyData.setModifiedFlagName( ModifiedColumnNameResolver.getName( propertyName, modifiedFlagSuffix ) );
|
||||
|
@ -724,11 +716,6 @@ public class AuditedPropertiesReader {
|
|||
}
|
||||
|
||||
private static final Audited DEFAULT_AUDITED = new Audited() {
|
||||
@Override
|
||||
public ModificationStore modStore() {
|
||||
return ModificationStore.FULL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RelationTargetAuditMode targetAuditMode() {
|
||||
return RelationTargetAuditMode.AUDITED;
|
||||
|
|
|
@ -8,7 +8,6 @@ package org.hibernate.envers.configuration.internal.metadata.reader;
|
|||
|
||||
import org.hibernate.annotations.common.reflection.XProperty;
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.hibernate.envers.ModificationStore;
|
||||
import org.hibernate.envers.boot.internal.ModifiedColumnNameResolver;
|
||||
import org.hibernate.envers.boot.spi.EnversMetadataBuildingContext;
|
||||
import org.hibernate.internal.util.StringHelper;
|
||||
|
@ -24,21 +23,18 @@ public class ComponentAuditedPropertiesReader extends AuditedPropertiesReader {
|
|||
|
||||
public ComponentAuditedPropertiesReader(
|
||||
EnversMetadataBuildingContext metadataBuildingContext,
|
||||
ModificationStore defaultStore,
|
||||
PersistentPropertiesSource persistentPropertiesSource,
|
||||
AuditedPropertiesHolder auditedPropertiesHolder) {
|
||||
this( metadataBuildingContext, defaultStore, persistentPropertiesSource, auditedPropertiesHolder, NO_PREFIX );
|
||||
this( metadataBuildingContext, persistentPropertiesSource, auditedPropertiesHolder, NO_PREFIX );
|
||||
}
|
||||
|
||||
public ComponentAuditedPropertiesReader(
|
||||
EnversMetadataBuildingContext metadataBuildingContext,
|
||||
ModificationStore defaultStore,
|
||||
PersistentPropertiesSource persistentPropertiesSource,
|
||||
AuditedPropertiesHolder auditedPropertiesHolder,
|
||||
String propertyNamePrefix) {
|
||||
super(
|
||||
metadataBuildingContext,
|
||||
defaultStore,
|
||||
persistentPropertiesSource,
|
||||
auditedPropertiesHolder,
|
||||
propertyNamePrefix
|
||||
|
@ -55,7 +51,6 @@ public class ComponentAuditedPropertiesReader extends AuditedPropertiesReader {
|
|||
// Checking if this property is explicitly audited or if all properties are.
|
||||
final Audited aud = property.getAnnotation( Audited.class );
|
||||
if ( aud != null ) {
|
||||
propertyData.setStore( aud.modStore() );
|
||||
propertyData.setRelationTargetAuditMode( aud.targetAuditMode() );
|
||||
propertyData.setUsingModifiedFlag( checkUsingModifiedFlag( aud ) );
|
||||
propertyData.setModifiedFlagName( ModifiedColumnNameResolver.getName( propertyName, modifiedFlagSuffix ) );
|
||||
|
@ -63,9 +58,6 @@ public class ComponentAuditedPropertiesReader extends AuditedPropertiesReader {
|
|||
propertyData.setExplicitModifiedFlagName( aud.modifiedColumnName() );
|
||||
}
|
||||
}
|
||||
else {
|
||||
propertyData.setStore( ModificationStore.FULL );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ import jakarta.persistence.EnumType;
|
|||
|
||||
import org.hibernate.envers.AuditOverride;
|
||||
import org.hibernate.envers.AuditOverrides;
|
||||
import org.hibernate.envers.ModificationStore;
|
||||
import org.hibernate.envers.RelationTargetAuditMode;
|
||||
import org.hibernate.envers.internal.entities.PropertyData;
|
||||
import org.hibernate.envers.internal.tools.StringTools;
|
||||
|
@ -31,7 +30,6 @@ import org.hibernate.type.Type;
|
|||
public class PropertyAuditingData {
|
||||
private String name;
|
||||
private String beanName;
|
||||
private ModificationStore store;
|
||||
private String mapKey;
|
||||
private EnumType mapKeyEnumType;
|
||||
private AuditJoinTableData joinTable;
|
||||
|
@ -69,7 +67,6 @@ public class PropertyAuditingData {
|
|||
this(
|
||||
name,
|
||||
accessType,
|
||||
ModificationStore.FULL,
|
||||
RelationTargetAuditMode.AUDITED,
|
||||
null,
|
||||
null,
|
||||
|
@ -97,7 +94,6 @@ public class PropertyAuditingData {
|
|||
this(
|
||||
name,
|
||||
accessType,
|
||||
ModificationStore.FULL,
|
||||
RelationTargetAuditMode.AUDITED,
|
||||
null,
|
||||
null,
|
||||
|
@ -110,7 +106,6 @@ public class PropertyAuditingData {
|
|||
public PropertyAuditingData(
|
||||
String name,
|
||||
String accessType,
|
||||
ModificationStore store,
|
||||
RelationTargetAuditMode relationTargetAuditMode,
|
||||
String auditMappedBy,
|
||||
String positionMappedBy,
|
||||
|
@ -120,7 +115,6 @@ public class PropertyAuditingData {
|
|||
this.name = name;
|
||||
this.beanName = name;
|
||||
this.accessType = accessType;
|
||||
this.store = store;
|
||||
this.relationTargetAuditMode = relationTargetAuditMode;
|
||||
this.auditMappedBy = auditMappedBy;
|
||||
this.positionMappedBy = positionMappedBy;
|
||||
|
@ -145,22 +139,6 @@ public class PropertyAuditingData {
|
|||
this.beanName = beanName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 5.2, to be removed in 6.0 with no replacement.
|
||||
*/
|
||||
@Deprecated
|
||||
public ModificationStore getStore() {
|
||||
return store;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 5.2, to be removed in 6.0 with no replacement.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setStore(ModificationStore store) {
|
||||
this.store = store;
|
||||
}
|
||||
|
||||
public String getMapKey() {
|
||||
return mapKey;
|
||||
}
|
||||
|
@ -341,7 +319,6 @@ public class PropertyAuditingData {
|
|||
name,
|
||||
beanName,
|
||||
accessType,
|
||||
store,
|
||||
usingModifiedFlag,
|
||||
modifiedFlagName,
|
||||
synthetic,
|
||||
|
@ -354,7 +331,6 @@ public class PropertyAuditingData {
|
|||
name,
|
||||
beanName,
|
||||
accessType,
|
||||
store,
|
||||
usingModifiedFlag,
|
||||
modifiedFlagName,
|
||||
synthetic,
|
||||
|
@ -365,7 +341,6 @@ public class PropertyAuditingData {
|
|||
name,
|
||||
beanName,
|
||||
accessType,
|
||||
store,
|
||||
usingModifiedFlag,
|
||||
modifiedFlagName,
|
||||
synthetic,
|
||||
|
|
|
@ -8,7 +8,6 @@ package org.hibernate.envers.internal.entities;
|
|||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.hibernate.envers.ModificationStore;
|
||||
import org.hibernate.type.Type;
|
||||
|
||||
/**
|
||||
|
@ -24,7 +23,6 @@ public class PropertyData {
|
|||
*/
|
||||
private final String beanName;
|
||||
private final String accessType;
|
||||
private final ModificationStore store;
|
||||
private boolean usingModifiedFlag;
|
||||
private String modifiedFlagName;
|
||||
// Synthetic properties are ones which are not part of the actual java model.
|
||||
|
@ -43,7 +41,6 @@ public class PropertyData {
|
|||
this.name = newName;
|
||||
this.beanName = propertyData.beanName;
|
||||
this.accessType = propertyData.accessType;
|
||||
this.store = propertyData.store;
|
||||
|
||||
this.usingModifiedFlag = propertyData.usingModifiedFlag;
|
||||
this.modifiedFlagName = propertyData.modifiedFlagName;
|
||||
|
@ -56,17 +53,15 @@ public class PropertyData {
|
|||
* @param name Name of the property.
|
||||
* @param beanName Name of the property in the bean.
|
||||
* @param accessType Accessor type for this property.
|
||||
* @param store How this property should be stored.
|
||||
*/
|
||||
public PropertyData(String name, String beanName, String accessType, ModificationStore store) {
|
||||
public PropertyData(String name, String beanName, String accessType) {
|
||||
this.name = name;
|
||||
this.beanName = beanName;
|
||||
this.accessType = accessType;
|
||||
this.store = store;
|
||||
}
|
||||
|
||||
private PropertyData(String name, String beanName, String accessType, ModificationStore store, Type propertyType) {
|
||||
this( name, beanName, accessType, store );
|
||||
private PropertyData(String name, String beanName, String accessType, Type propertyType) {
|
||||
this( name, beanName, accessType );
|
||||
this.propertyType = propertyType;
|
||||
}
|
||||
|
||||
|
@ -74,18 +69,16 @@ public class PropertyData {
|
|||
* @param name Name of the property.
|
||||
* @param beanName Name of the property in the bean.
|
||||
* @param accessType Accessor type for this property.
|
||||
* @param store How this property should be stored.
|
||||
* @param usingModifiedFlag Defines if field changes should be tracked
|
||||
*/
|
||||
public PropertyData(
|
||||
String name,
|
||||
String beanName,
|
||||
String accessType,
|
||||
ModificationStore store,
|
||||
boolean usingModifiedFlag,
|
||||
String modifiedFlagName,
|
||||
boolean synthetic) {
|
||||
this( name, beanName, accessType, store );
|
||||
this( name, beanName, accessType );
|
||||
this.usingModifiedFlag = usingModifiedFlag;
|
||||
this.modifiedFlagName = modifiedFlagName;
|
||||
this.synthetic = synthetic;
|
||||
|
@ -95,25 +88,23 @@ public class PropertyData {
|
|||
String name,
|
||||
String beanName,
|
||||
String accessType,
|
||||
ModificationStore store,
|
||||
boolean usingModifiedFlag,
|
||||
String modifiedFlagName,
|
||||
boolean synthetic,
|
||||
Type propertyType) {
|
||||
this( name, beanName, accessType, store, usingModifiedFlag, modifiedFlagName, synthetic, propertyType, null );
|
||||
this( name, beanName, accessType, usingModifiedFlag, modifiedFlagName, synthetic, propertyType, null );
|
||||
}
|
||||
|
||||
public PropertyData(
|
||||
String name,
|
||||
String beanName,
|
||||
String accessType,
|
||||
ModificationStore store,
|
||||
boolean usingModifiedFlag,
|
||||
String modifiedFlagName,
|
||||
boolean synthetic,
|
||||
Type propertyType,
|
||||
Class<?> virtualReturnClass) {
|
||||
this( name, beanName, accessType, store, usingModifiedFlag, modifiedFlagName, synthetic );
|
||||
this( name, beanName, accessType, usingModifiedFlag, modifiedFlagName, synthetic );
|
||||
this.propertyType = propertyType;
|
||||
this.virtualReturnClass = virtualReturnClass;
|
||||
}
|
||||
|
@ -130,14 +121,6 @@ public class PropertyData {
|
|||
return accessType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 5.2, to be removed in 6.0 with no replacement.
|
||||
*/
|
||||
@Deprecated
|
||||
public ModificationStore getStore() {
|
||||
return store;
|
||||
}
|
||||
|
||||
public boolean isUsingModifiedFlag() {
|
||||
return usingModifiedFlag;
|
||||
}
|
||||
|
@ -169,7 +152,6 @@ public class PropertyData {
|
|||
|
||||
final PropertyData that = (PropertyData) o;
|
||||
return usingModifiedFlag == that.usingModifiedFlag
|
||||
&& store == that.store
|
||||
&& Objects.equals( accessType, that.accessType )
|
||||
&& Objects.equals( beanName, that.beanName )
|
||||
&& Objects.equals( name, that.name )
|
||||
|
@ -181,7 +163,6 @@ public class PropertyData {
|
|||
int result = name != null ? name.hashCode() : 0;
|
||||
result = 31 * result + (beanName != null ? beanName.hashCode() : 0);
|
||||
result = 31 * result + (accessType != null ? accessType.hashCode() : 0);
|
||||
result = 31 * result + (store != null ? store.hashCode() : 0);
|
||||
result = 31 * result + (usingModifiedFlag ? 1 : 0);
|
||||
result = 31 * result + (synthetic ? 1 : 0);
|
||||
return result;
|
||||
|
@ -192,7 +173,6 @@ public class PropertyData {
|
|||
propertyName,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
propertyType
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue