Package org.hibernate.reflection

Examples of org.hibernate.reflection.XProperty


    assertEquals( properties.size(), methodProperties.size() );
    for ( XProperty member : methodProperties ) {
      assertTrue( properties.contains( member.getName() ) );
    }
    List<XProperty> fieldProperties = dadAsSeenFromSon.getDeclaredProperties( "field" );
    XProperty field = fieldProperties.get( 0 );
    assertEquals( "fieldProperty", field.getName() );
  }
View Full Code Here


  public void testReturnsPropertiesWithUnresolvedParametricTypes() {
    assertEquals( 7, dadAsSeenFromItself.getDeclaredProperties( "property" ).size() );
  }

  public void testKnowsWhetherItsTypeIsFullyResolved() {
    XProperty notFullyResolvedProperty = getPropertyNamed_from(
        "collectionProperty", dadAsSeenFromItself
        .getDeclaredProperties( "property" )
    );
    assertFalse( notFullyResolvedProperty.isTypeResolved() );
    XProperty fullyResolvedProperty = getPropertyNamed_from(
        "collectionProperty", dadAsSeenFromSon
        .getDeclaredProperties( "property" )
    );
    assertTrue( fullyResolvedProperty.isTypeResolved() );
  }
View Full Code Here

    );
  }

  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() );
  }
View Full Code Here

    assertFalse( p.isCollection() );
  }

  public void testResolveInterfaceType() {
    List<XProperty> declaredProperties = dadAsSeenFromSon.getDeclaredProperties( "property" );
    XProperty p = getPropertyNamed_from( "language", 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() );
    assertNull( p.getMapKey() );
    assertFalse( p.isArray() );
    assertFalse( p.isCollection() );
  }
View Full Code Here

    assertFalse( p.isCollection() );
  }

  public void testCanBeAnArray() {
    List<XProperty> declaredProperties = dadAsSeenFromSon.getDeclaredProperties( "property" );
    XProperty p = getPropertyNamed_from( "arrayProperty", 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() );
    assertNull( p.getMapKey() );
    assertTrue( p.isArray() );
    assertFalse( p.isCollection() );
  }
View Full Code Here

    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() );
  }
View Full Code Here

    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() );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.reflection.XProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.