Cleanups in ClassTypeInformation as well as BasicMappingContext.

Removed obsolete constructor arguments in ClassTypeInformation. SKip static fields in BasicMappingContext.addPersistentEntity(…).
This commit is contained in:
Oliver Gierke
2011-03-17 22:55:26 +01:00
parent f00bfb82bd
commit 561cdbe4dc
2 changed files with 8 additions and 14 deletions

View File

@@ -21,6 +21,7 @@ import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -161,6 +162,10 @@ public class BasicMappingContext implements MappingContext, InitializingBean, Ap
log.error(e.getMessage(), e);
}
}
}, new ReflectionUtils.FieldFilter() {
public boolean matches(Field field) {
return !Modifier.isStatic(field.getModifiers());
}
});
entity.setPreferredConstructor(builder.getPreferredConstructor(type));

View File

@@ -20,26 +20,15 @@ public class ClassTypeInformation extends TypeDiscoverer {
* @param type
*/
public ClassTypeInformation(Class<?> type) {
this(type, GenericTypeResolver.getTypeVariableMap(type), null, null);
}
/**
* Creates {@link ClassTypeInformation} for the given type and the given basic types. Handing over a basic type will
* prevent it's nested fields to be traversed for further {@link TypeInformation}.
*
* @param type
* @param basicTypes
*/
public ClassTypeInformation(Class<?> type, Set<Class<?>> basicTypes) {
this(type, GenericTypeResolver.getTypeVariableMap(type), basicTypes, null);
this(type, GenericTypeResolver.getTypeVariableMap(type), null);
}
ClassTypeInformation(Class<?> type, TypeDiscoverer parent) {
this(type, null, null, parent);
this(type, null, parent);
}
@SuppressWarnings("rawtypes")
ClassTypeInformation(Class<?> type, Map<TypeVariable, Type> typeVariableMap, Set<Class<?>> basicTypes,
ClassTypeInformation(Class<?> type, Map<TypeVariable, Type> typeVariableMap,
TypeDiscoverer parent) {
super(type, typeVariableMap, parent);
this.type = type;