private static boolean mustBeSkipped(XProperty property) { //TODO make those hardcoded tests more portable (through the bytecode provider?) return property.isAnnotationPresent( Transient.class ) || "net.sf.cglib.transform.impl.InterceptFieldCallback".equals( property.getType().getName() ) || "org.hibernate.bytecode.internal.javassist.FieldHandler".equals( property.getType().getName() ); } }
@Override public Class getIdType() { return buildingContext .getBootstrapContext() .getReflectionManager() .toClass( idXProperty.getType() ); }
public XClass getPropertyClass() throws MappingException { if ( property.isAnnotationPresent( Target.class ) ) { return reflectionManager.toXClass( property.getAnnotation( Target.class ).value() ); } else { return property.getType(); } }
xProperty.getDeclaringClass().getName(), xProperty.getName(), xProperty.getType().getName() );
final Map<String,AttributeConversionInfo> infoMap = new HashMap<String, AttributeConversionInfo>(); final XClass embeddableXClass = embeddedXProperty.getType();
valueGeneration.initialize( annotation, buildingContext.getBootstrapContext().getReflectionManager().toClass( property.getType() ) );
final XClass revisionNumberClass = property.getType(); if ( reflectionManager.equals( revisionNumberClass, Integer.class ) || reflectionManager.equals( revisionNumberClass, Integer.TYPE ) ) { final XClass revisionTimestampClass = property.getType(); if ( reflectionManager.equals( revisionTimestampClass, Long.class ) || reflectionManager.equals( revisionTimestampClass, Long.TYPE ) || throw new MappingException( "Only one property may be annotated with @ModifiedEntityNames!" ); final XClass modifiedEntityNamesClass = property.getType(); if ( reflectionManager.equals( modifiedEntityNamesClass, Set.class ) && reflectionManager.equals( property.getElementClass(), String.class ) ) {
private static boolean mustBeSkipped(XProperty property) { //TODO make those hardcoded tests more portable (through the bytecode provider?) return property.isAnnotationPresent( Transient.class ) || "net.sf.cglib.transform.impl.InterceptFieldCallback".equals( property.getType().getName() ) || "org.hibernate.bytecode.javassist.FieldHandler".equals( property.getType().getName() ); } }
GeneratedValue generatedValue = property.getAnnotation( GeneratedValue.class ); String generatorType = generatedValue != null ? generatorType( generatedValue, buildingContext, property.getType() ) : "assigned"; String generator = generatedValue != null ?
public XClass getPropertyClass() throws MappingException { if ( property.isAnnotationPresent( Target.class ) ) { return reflectionManager.toXClass( property.getAnnotation( Target.class ).value() ); } else { return property.getType(); } }
private static boolean mustBeSkipped(XProperty property) { //TODO make those hardcoded tests more portable (through the bytecode provider?) return property.isAnnotationPresent( Transient.class ) || "net.sf.cglib.transform.impl.InterceptFieldCallback".equals( property.getType().getName() ) || "org.hibernate.bytecode.internal.javassist.FieldHandler".equals( property.getType().getName() ); } }
private static boolean mustBeSkipped(XProperty property) { //TODO make those hardcoded tests more portable (through the bytecode provider?) return property.isAnnotationPresent( Transient.class ) || "net.sf.cglib.transform.impl.InterceptFieldCallback".equals( property.getType().getName() ) || "org.hibernate.bytecode.internal.javassist.FieldHandler".equals( property.getType().getName() ); } }
private static boolean mustBeSkipped(XProperty property) { //TODO make those hardcoded tests more portable (through the bytecode provider?) return property.isAnnotationPresent( Transient.class ) || "net.sf.cglib.transform.impl.InterceptFieldCallback".equals( property.getType().getName() ) || "org.hibernate.bytecode.internal.javassist.FieldHandler".equals( property.getType().getName() ); } }
@Override public Class getIdType() { return buildingContext .getBootstrapContext() .getReflectionManager() .toClass( idXProperty.getType() ); }
public XClass getPropertyClass() throws MappingException { if ( property.isAnnotationPresent( Target.class ) ) { return reflectionManager.toXClass( property.getAnnotation( Target.class ).value() ); } else { return property.getType(); } }
public XClass getPropertyClass() throws MappingException { if ( property.isAnnotationPresent( Target.class ) ) { return reflectionManager.toXClass( property.getAnnotation( Target.class ).value() ); } else { return property.getType(); } }
public void test2StepsGenerics() throws Exception { JavaReflectionManager factory = new JavaReflectionManager(); XClass subclass2 = factory.toXClass( Subclass2.class ); XClass dummySubclass = factory.toXClass( DummySubclass.class ); XClass superclass = subclass2.getSuperclass(); XClass supersuperclass = superclass.getSuperclass(); assertTrue( supersuperclass.getDeclaredProperties( "field" ).get( 1 ).isTypeResolved() ); assertEquals( dummySubclass, supersuperclass.getDeclaredProperties( "field" ).get( 1 ).getType() ); } }
public void testCanBeASimpleType() { List<XProperty> declaredProperties = dadAsSeenFromSon.getDeclaredProperties( "field" ); XProperty p = getPropertyNamed_from( "fieldProperty", declaredProperties ); assertTrue( factory.equals( p.getType(), String.class ) ); assertTrue( factory.equals( p.getElementClass(), String.class ) ); assertTrue( factory.equals( p.getClassOrElementClass(), String.class ) ); assertNull( p.getCollectionClass() ); assertFalse( p.isArray() ); assertFalse( p.isCollection() ); }
public void testCanBeAnArrayOfPrimitives() { List<XProperty> declaredProperties = dadAsSeenFromSon.getDeclaredProperties( "property" ); XProperty p = getPropertyNamed_from( "primitiveArrayProperty", declaredProperties ); assertTrue( factory.equals( p.getType(), int[].class ) ); assertTrue( factory.equals( p.getElementClass(), int.class ) ); assertTrue( factory.equals( p.getClassOrElementClass(), int.class ) ); assertNull( p.getCollectionClass() ); assertNull( p.getMapKey() ); assertTrue( p.isArray() ); assertFalse( p.isCollection() ); }
public void testCanBeACollection() { List<XProperty> declaredProperties = dadAsSeenFromSon.getDeclaredProperties( "property" ); XProperty p = getPropertyNamed_from( "collectionProperty", declaredProperties ); assertTrue( factory.equals( p.getType(), Map.class ) ); assertTrue( factory.equals( p.getElementClass(), String.class ) ); assertTrue( factory.equals( p.getClassOrElementClass(), Map.class ) ); assertTrue( factory.equals( p.getMapKey(), Double.class ) ); assertEquals( Map.class, p.getCollectionClass() ); assertFalse( p.isArray() ); assertTrue( p.isCollection() ); }