removed @Override on interface methods that will cause problems in Java 5
This commit is contained in:
@@ -9,7 +9,6 @@ package org.springframework.persistence.support;
|
||||
*/
|
||||
public class ChangeSetConstructorEntityInstantiator extends AbstractConstructorEntityInstantiator<ChangeSetBacked, ChangeSet>{
|
||||
|
||||
@Override
|
||||
protected void setState(ChangeSetBacked entity, ChangeSet cs) {
|
||||
entity.setChangeSet(cs);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ public class BasicMappingConfigurationBuilder implements MappingConfigurationBui
|
||||
protected static ConcurrentMap<Class<?>, BeanInfo> beanInfo = new ConcurrentHashMap<Class<?>, BeanInfo>();
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Override
|
||||
public <T> boolean isPersistentEntity(Class<T> type) {
|
||||
if (type.isAnnotationPresent(Persistent.class)) {
|
||||
return true;
|
||||
@@ -64,12 +63,10 @@ public class BasicMappingConfigurationBuilder implements MappingConfigurationBui
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> PersistentEntity<T> createPersistentEntity(TypeInformation typeInformation, MappingContext mappingContext) throws MappingConfigurationException {
|
||||
return new BasicPersistentEntity<T>(mappingContext, typeInformation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPersistentProperty(Field field, PropertyDescriptor descriptor) throws MappingConfigurationException {
|
||||
if (UNMAPPED_FIELDS.contains(field.getName()) || isTransient(field)) {
|
||||
return false;
|
||||
@@ -77,13 +74,11 @@ public class BasicMappingConfigurationBuilder implements MappingConfigurationBui
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PersistentProperty createPersistentProperty(Field field, PropertyDescriptor descriptor, TypeInformation information) throws MappingConfigurationException {
|
||||
return new BasicPersistentProperty(field, descriptor, information);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
@Override
|
||||
public <T> PreferredConstructor<T> getPreferredConstructor(Class<T> type) throws MappingConfigurationException {
|
||||
// Find the right constructor
|
||||
PreferredConstructor<T> preferredConstructor = null;
|
||||
@@ -137,7 +132,6 @@ public class BasicMappingConfigurationBuilder implements MappingConfigurationBui
|
||||
return preferredConstructor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAssociation(Field field, PropertyDescriptor descriptor) throws MappingConfigurationException {
|
||||
if (!isTransient(field)) {
|
||||
if (field.isAnnotationPresent(Reference.class)) {
|
||||
@@ -152,7 +146,6 @@ public class BasicMappingConfigurationBuilder implements MappingConfigurationBui
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Association createAssociation(PersistentProperty property) {
|
||||
// Only support uni-directional associations in the Basic configuration
|
||||
Association association = new Association(property, null);
|
||||
|
||||
@@ -89,12 +89,10 @@ public class BasicMappingContext implements MappingContext, InitializingBean, Ap
|
||||
this.customSimpleTypes = customSimpleTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PersistentEntity<?>> getPersistentEntities() {
|
||||
return persistentEntities.values();
|
||||
}
|
||||
@@ -102,13 +100,11 @@ public class BasicMappingContext implements MappingContext, InitializingBean, Ap
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.MappingContext#getPersistentEntity(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> PersistentEntity<T> getPersistentEntity(Class<T> type) {
|
||||
return getPersistentEntity(new ClassTypeInformation(type));
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
@Override
|
||||
public <T> PersistentEntity<T> getPersistentEntity(TypeInformation type) {
|
||||
return (PersistentEntity<T>) persistentEntities.get(type);
|
||||
}
|
||||
@@ -135,7 +131,6 @@ public class BasicMappingContext implements MappingContext, InitializingBean, Ap
|
||||
|
||||
ReflectionUtils.doWithFields(type, new FieldCallback() {
|
||||
|
||||
@Override
|
||||
public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
|
||||
try {
|
||||
PropertyDescriptor descriptor = descriptors.get(field.getName());
|
||||
@@ -222,12 +217,10 @@ public class BasicMappingContext implements MappingContext, InitializingBean, Ap
|
||||
return information == null || MappingBeanHelper.isSimpleType(information.getType()) ? null : information;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> PersistentEntity<T> addPersistentEntity(Class<T> type) {
|
||||
return addPersistentEntity(new ClassTypeInformation(type));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEntityValidator(PersistentEntity<?> entity, Validator validator) {
|
||||
List<Validator> v = validators.get(entity);
|
||||
if (null == v) {
|
||||
@@ -237,37 +230,30 @@ public class BasicMappingContext implements MappingContext, InitializingBean, Ap
|
||||
v.add(validator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S, T> void addTypeConverter(Converter<S, T> converter) {
|
||||
conversionService.addConverter(converter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConversionService getConversionService() {
|
||||
return conversionService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConverterRegistry getConverterRegistry() {
|
||||
return conversionService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Validator> getEntityValidators(PersistentEntity<?> entity) {
|
||||
return validators.get(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MappingConfigurationBuilder getMappingConfigurationBuilder() {
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMappingConfigurationBuilder(MappingConfigurationBuilder builder) {
|
||||
this.builder = builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPersistentEntity(Object value) {
|
||||
if (null != value) {
|
||||
Class<?> clazz;
|
||||
@@ -281,7 +267,6 @@ public class BasicMappingContext implements MappingContext, InitializingBean, Ap
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
Assert.notNull(builder, "No mapping configuration provider configured.");
|
||||
}
|
||||
|
||||
@@ -49,47 +49,38 @@ public class BasicPersistentEntity<T> implements PersistentEntity<T> {
|
||||
this.information = information;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PreferredConstructor<T> getPreferredConstructor() {
|
||||
return preferredConstructor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPreferredConstructor(PreferredConstructor<T> constructor) {
|
||||
this.preferredConstructor = constructor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return type.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PersistentProperty getIdProperty() {
|
||||
return idProperty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdProperty(PersistentProperty property) {
|
||||
idProperty = property;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PersistentProperty> getPersistentProperties() {
|
||||
return persistentProperties.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPersistentProperty(PersistentProperty property) {
|
||||
persistentProperties.put(property.getName(), property);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Association> getAssociations() {
|
||||
return associations.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAssociation(Association association) {
|
||||
associations.put(association.getInverse().getName(), association);
|
||||
}
|
||||
@@ -98,32 +89,26 @@ public class BasicPersistentEntity<T> implements PersistentEntity<T> {
|
||||
return persistentProperties.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<T> getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeInformation getPropertyInformation() {
|
||||
return information;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getPersistentPropertyNames() {
|
||||
return persistentProperties.keySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MappingContext getMappingContext() {
|
||||
return mappingContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doWithProperties(PropertyHandler handler) {
|
||||
for (PersistentProperty property : persistentProperties.values()) {
|
||||
if (!property.isTransient() && !property.isAssociation() && !property.isIdProperty()) {
|
||||
@@ -132,7 +117,6 @@ public class BasicPersistentEntity<T> implements PersistentEntity<T> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doWithAssociations(AssociationHandler handler) {
|
||||
for (Association association : associations.values()) {
|
||||
handler.doWithAssociation(association);
|
||||
|
||||
@@ -64,75 +64,60 @@ public class BasicPersistentProperty implements PersistentProperty {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOwner(Object owner) {
|
||||
if (null != owner && owner.getClass().isAssignableFrom(PersistentEntity.class)) {
|
||||
this.owner = (PersistentEntity<?>) owner;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getType() {
|
||||
return information.getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeInformation getTypeInformation() {
|
||||
return information;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyDescriptor getPropertyDescriptor() {
|
||||
return propertyDescriptor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Field getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Value getValueAnnotation() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTransient() {
|
||||
return isTransient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAssociation() {
|
||||
return null != association;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Association getAssociation() {
|
||||
return association;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAssociation(Association association) {
|
||||
this.association = association;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCollection() {
|
||||
return Collection.class.isAssignableFrom(getType()) || isArray();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isMap() {
|
||||
return Map.class.isAssignableFrom(getType());
|
||||
}
|
||||
@@ -140,12 +125,10 @@ public class BasicPersistentProperty implements PersistentProperty {
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.PersistentProperty#isArray()
|
||||
*/
|
||||
@Override
|
||||
public boolean isArray() {
|
||||
return getType().isArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isComplexType() {
|
||||
if (isCollection() || isArray()) {
|
||||
return !MappingBeanHelper.isSimpleType(getComponentType());
|
||||
@@ -154,12 +137,10 @@ public class BasicPersistentProperty implements PersistentProperty {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntity() {
|
||||
return isComplexType() && !isTransient() && !isCollection() && !isMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getComponentType() {
|
||||
return isMap() || isCollection() ? information.getComponentType().getType() : null;
|
||||
}
|
||||
@@ -167,12 +148,10 @@ public class BasicPersistentProperty implements PersistentProperty {
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.mapping.model.PersistentProperty#getMapValueType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getMapValueType() {
|
||||
return isMap() ? information.getMapValueType().getType() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIdProperty() {
|
||||
return field.isAnnotationPresent(Id.class);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,6 @@ public abstract class RepositoryFactoryBeanSupport<T extends Repository<S, ID>,
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryFactoryInformation#getRepositoryInterface()
|
||||
*/
|
||||
@Override
|
||||
public Class<? extends T> getRepositoryInterface() {
|
||||
|
||||
return repositoryInterface;
|
||||
|
||||
@@ -147,7 +147,6 @@ class TypeDiscoverer implements TypeInformation {
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.util.TypeInformation#getMapValueType()
|
||||
*/
|
||||
@Override
|
||||
public TypeInformation getMapValueType() {
|
||||
|
||||
if (!Map.class.isAssignableFrom(getType())) {
|
||||
@@ -161,7 +160,6 @@ class TypeDiscoverer implements TypeInformation {
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.util.TypeInformation#getComponentType()
|
||||
*/
|
||||
@Override
|
||||
public TypeInformation getComponentType() {
|
||||
|
||||
if (!(Map.class.isAssignableFrom(getType()) || Collection.class.isAssignableFrom(getType()))) {
|
||||
|
||||
@@ -70,7 +70,6 @@ public class AbstractEntityInformationUnitTests {
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.EntityInformation#getIdType()
|
||||
*/
|
||||
@Override
|
||||
public Class<Serializable> getIdType() {
|
||||
|
||||
return Serializable.class;
|
||||
|
||||
Reference in New Issue
Block a user