Examples of XProperty


Examples of org.hibernate.annotations.common.reflection.XProperty

     * @param clazz Class.
     * @param propertyName Property name.
     * @return Property object.
     */
    private XProperty getProperty(XClass clazz, String propertyName) {
        XProperty property = Tools.getProperty(clazz, propertyName);
        if (property == null) {
            throw new MappingException("Property '" + propertyName + "' not found in class " + clazz.getName() + ". " +
                                       "Please revise Envers annotations applied to class " + persistentPropertiesSource.getXClass() + ".");
        }
        return property;
View Full Code Here

Examples of org.hibernate.annotations.common.reflection.XProperty

    }
    return columns;
  }

  private static void applyColumnDefault(Ejb3Column column, PropertyData inferredData) {
    final XProperty xProperty = inferredData.getProperty();
    if ( xProperty != null ) {
      ColumnDefault columnDefaultAnn = xProperty.getAnnotation( ColumnDefault.class );
      if ( columnDefaultAnn != null ) {
        column.setDefaultValue( columnDefaultAnn.value() );
      }
    }
    else {
View Full Code Here

Examples of org.hibernate.annotations.common.reflection.XProperty

  }

  //must only be called after all setters are defined and before bind
  private void extractDataFromPropertyData(PropertyData inferredData) {
    if ( inferredData != null ) {
      XProperty property = inferredData.getProperty();
      if ( property != null ) {
        processExpression( property.getAnnotation( ColumnTransformer.class ) );
        ColumnTransformers annotations = property.getAnnotation( ColumnTransformers.class );
        if (annotations != null) {
          for ( ColumnTransformer annotation : annotations.value() ) {
            processExpression( annotation );
          }
        }
View Full Code Here

Examples of org.hibernate.annotations.common.reflection.XProperty

     * @param clazz Source class.
     * @param propertyName Property name.
     * @return Property object or {@code null} if none with expected name has been found.
     */
    public static XProperty getProperty(XClass clazz, String propertyName) {
        XProperty property = getProperty(clazz, propertyName, "field");
        if (property == null) {
            property = getProperty(clazz, propertyName, "property");
        }
        return property;
    }
View Full Code Here

Examples of org.hibernate.annotations.common.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

Examples of org.hibernate.annotations.common.reflection.XProperty

  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

Examples of org.hibernate.annotations.common.reflection.XProperty

    );
  }

  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

Examples of org.hibernate.annotations.common.reflection.XProperty

    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

Examples of org.hibernate.annotations.common.reflection.XProperty

    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

Examples of org.hibernate.annotations.common.reflection.XProperty

    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
TOP
Copyright © 2018 www.massapi.com. 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.