Package org.hibernate.type

Examples of org.hibernate.type.Type


    }
    return this;
  }

  protected Type determineType(int paramPosition, Object paramValue, Type defaultType) {
    Type type = parameterMetadata.getOrdinalParameterExpectedType( paramPosition + 1 );
    if ( type == null ) {
      type = defaultType;
    }
    return type;
  }
View Full Code Here


    }
    return type;
  }

  protected Type determineType(int paramPosition, Object paramValue) throws HibernateException {
    Type type = parameterMetadata.getOrdinalParameterExpectedType( paramPosition + 1 );
    if ( type == null ) {
      type = guessType( paramValue );
    }
    return type;
  }
View Full Code Here

    }
    return type;
  }

  protected Type determineType(String paramName, Object paramValue, Type defaultType) {
    Type type = parameterMetadata.getNamedParameterExpectedType( paramName );
    if ( type == null ) {
      type = defaultType;
    }
    return type;
  }
View Full Code Here

    }
    return type;
  }

  protected Type determineType(String paramName, Object paramValue) throws HibernateException {
    Type type = parameterMetadata.getNamedParameterExpectedType( paramName );
    if ( type == null ) {
      type = guessType( paramValue );
    }
    return type;
  }
View Full Code Here

    }
    return type;
  }

  protected Type determineType(String paramName, Class clazz) throws HibernateException {
    Type type = parameterMetadata.getNamedParameterExpectedType( paramName );
    if ( type == null ) {
      type = guessType( clazz );
    }
    return type;
  }
View Full Code Here

    return guessType( clazz );
  }

  private Type guessType(Class clazz) throws HibernateException {
    String typename = clazz.getName();
    Type type = TypeFactory.heuristicType(typename);
    boolean serializable = type!=null && type instanceof SerializableType;
    if (type==null || serializable) {
      try {
        session.getFactory().getEntityPersister( clazz.getName() );
      }
View Full Code Here

    return this;
  }

  public Query setBoolean(int position, boolean val) {
    Boolean valueToUse = val ? Boolean.TRUE : Boolean.FALSE;
    Type typeToUse = determineType( position, valueToUse, Hibernate.BOOLEAN );
    setParameter( position, valueToUse, typeToUse );
    return this;
  }
View Full Code Here

    return this;
  }

  public Query setBoolean(String name, boolean val) {
    Boolean valueToUse = val ? Boolean.TRUE : Boolean.FALSE;
    Type typeToUse = determineType( name, valueToUse, Hibernate.BOOLEAN );
    setParameter( name, valueToUse, typeToUse );
    return this;
  }
View Full Code Here

   * Warning: adds new parameters to the argument by side-effect, as well as
   * mutating the query string!
   */
  private String expandParameterList(String query, String name, TypedValue typedList, Map namedParamsCopy) {
    Collection vals = (Collection) typedList.getValue();
    Type type = typedList.getType();
    if ( vals.size() == 1 ) {
      // short-circuit for performance...
      namedParamsCopy.put( name, new TypedValue( type, vals.iterator().next(), session.getEntityMode() ) );
      return query;
    }
View Full Code Here

    String[] parsed = parseFilterParameterName(filterParameterName);
    FilterDefinition filterDef = factory.getFilterDefinition( parsed[0] );
    if (filterDef == null) {
      throw new IllegalArgumentException("Filter [" + parsed[0] + "] not defined");
    }
    Type type = filterDef.getParameterType( parsed[1] );
    if (type == null) {
      // this is an internal error of some sort...
      throw new InternalError("Unable to locate type for filter parameter");
    }
    return type;
View Full Code Here

TOP

Related Classes of org.hibernate.type.Type

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.