Examples of AliasToBeanConstructorResultTransformer


Examples of org.hibernate.transform.AliasToBeanConstructorResultTransformer

            .add(Projections.property("tier." + Tier.DATACENTER_PROPERTY))
            .add(Projections.property("tier." + Tier.ENABLED_PROPERTY))
            .add(Projections.property("tier." + Tier.DEFAULT_ALLOWED_PROPERTY)));
        try
        {
            criteria.setResultTransformer(new AliasToBeanConstructorResultTransformer(Tier.class
                .getConstructor(Integer.class, String.class, String.class, Datacenter.class,
                    boolean.class, boolean.class)));
        }
        catch (NoSuchMethodException ex)
        {
View Full Code Here

Examples of org.hibernate.transform.AliasToBeanConstructorResultTransformer

            criteria.add(Restrictions.eq("tier." + Tier.ENABLED_PROPERTY, onlyEnabled));
        }
        try
        {
            // return instances of Tier.class
            criteria.setResultTransformer(new AliasToBeanConstructorResultTransformer(Tier.class
                .getConstructor(Integer.class, String.class, String.class, Datacenter.class,
                    boolean.class, boolean.class)));
            return criteria;
        }
        catch (NoSuchMethodException ex)
View Full Code Here

Examples of org.hibernate.transform.AliasToBeanConstructorResultTransformer

  private boolean isMap;
  private boolean isList;

  public ResultTransformer getResultTransformer() {
    if ( constructor != null ) {
      return new AliasToBeanConstructorResultTransformer( constructor );
    }
    else if ( isMap ) {
      return Transformers.ALIAS_TO_ENTITY_MAP;
    }
    else if ( isList ) {
View Full Code Here

Examples of org.hibernate.transform.AliasToBeanConstructorResultTransformer

  private boolean isList;
  private int scalarColumnIndex = -1;

  public ResultTransformer getResultTransformer() {
    if ( constructor != null ) {
      return new AliasToBeanConstructorResultTransformer( constructor );
    }
    else if ( isMap ) {
      return Transformers.ALIAS_TO_ENTITY_MAP;
    }
    else if ( isList ) {
View Full Code Here

Examples of org.hibernate.transform.AliasToBeanConstructorResultTransformer

  private boolean isMap;
  private boolean isList;

  public ResultTransformer getResultTransformer() {
    if ( constructor != null ) {
      return new AliasToBeanConstructorResultTransformer( constructor );
    }
    else if ( isMap ) {
      return Transformers.ALIAS_TO_ENTITY_MAP;
    }
    else if ( isList ) {
View Full Code Here

Examples of org.hibernate.transform.AliasToBeanConstructorResultTransformer

  private boolean isMap;
  private boolean isList;

  public ResultTransformer getResultTransformer() {
    if ( constructor != null ) {
      return new AliasToBeanConstructorResultTransformer( constructor );
    }
    else if ( isMap ) {
      return Transformers.ALIAS_TO_ENTITY_MAP;
    }
    else if ( isList ) {
View Full Code Here

Examples of org.hibernate.transform.AliasToBeanConstructorResultTransformer

    return selectNewTransformer != null ? selectNewTransformer : customTransformer;
 

  public static ResultTransformer createSelectNewTransformer(Constructor constructor, boolean returnMaps, boolean returnLists) {
    if ( constructor != null ) {
      return new AliasToBeanConstructorResultTransformer(constructor);
    }
    else if ( returnMaps ) {
      return Transformers.ALIAS_TO_ENTITY_MAP;     
    }
    else if ( returnLists ) {
View Full Code Here

Examples of org.hibernate.transform.AliasToBeanConstructorResultTransformer

  }

  static public ResultTransformer resolveClassicResultTransformer(
      Constructor constructor,
      ResultTransformer transformer) {
    return constructor != null ? new AliasToBeanConstructorResultTransformer( constructor ) : transformer;
 
View Full Code Here

Examples of org.hibernate.transform.AliasToBeanConstructorResultTransformer

    CriteriaExecutor criteriaExecutor = new CriteriaExecutor() {
      protected Criteria getCriteria(Session s) throws Exception {
        return s.createCriteria( Student.class, "s" )
        .setProjection( Projections.property( "s.name" ) )
        .addOrder( Order.asc( "s.studentNumber" ) )
        .setResultTransformer( new AliasToBeanConstructorResultTransformer( getConstructor() ) );
      }
      private Constructor getConstructor() throws NoSuchMethodException {
        return StudentDTO.class.getConstructor( String.class );
      }
    };
View Full Code Here

Examples of org.hibernate.transform.AliasToBeanConstructorResultTransformer

    CriteriaExecutor criteriaExecutor = new CriteriaExecutor() {
      protected Criteria getCriteria(Session s) throws Exception {
        return s.createCriteria( Student.class, "s" )
        .setProjection( Projections.property( "s.name" ).as( "name" ))
        .addOrder( Order.asc( "s.studentNumber" ) )
        .setResultTransformer( new AliasToBeanConstructorResultTransformer( getConstructor() ) );
      }
      private Constructor getConstructor() throws NoSuchMethodException {
        return StudentDTO.class.getConstructor( String.class );
      }
    };
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.