Package org.hibernate.transform

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


  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

    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

  }

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

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

            Projections.projectionList()
                .add( Property.forName( "s.studentNumber" ) )
                .add( Property.forName( "s.name" ) )
        )
        .addOrder( Order.asc( "s.studentNumber" ) )
        .setResultTransformer( new AliasToBeanConstructorResultTransformer( getConstructor() ) );
      }
      private Constructor getConstructor() throws NoSuchMethodException {
        return  Student.class.getConstructor( long.class, PersonName.class );
      }
    };
View Full Code Here

            Projections.projectionList()
                .add( Projections.sqlProjection( "555 as sCode", new String[]{ "sCode" }, new Type[] { Hibernate.LONG } ) )
                .add( Property.forName( "s.name" ) )
        )
        .addOrder( Order.asc( "s.studentNumber" ) )
        .setResultTransformer( new AliasToBeanConstructorResultTransformer( getConstructor() ) );
      }
      private Constructor getConstructor() throws NoSuchMethodException {
        return Student.class.getConstructor( long.class, PersonName.class );
      }
    };
View Full Code Here

            Projections.projectionList()
                .add( Property.forName( "s.studentNumber" ) )
                .add( Property.forName( "s.name" ) )
        )
        .addOrder( Order.asc( "s.studentNumber" ) )
        .setResultTransformer( new AliasToBeanConstructorResultTransformer( getConstructor() ) );
      }
      private Constructor getConstructor() {
        Type studentNametype =
            ( ( SessionFactoryImpl ) getSessions() )
                .getEntityPersister( Student.class.getName() )
View Full Code Here

    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

  }

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

TOP

Related Classes of org.hibernate.transform.AliasToBeanConstructorResultTransformer

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.