Package org.hibernate.type

Examples of org.hibernate.type.IntegerType


public class HibernateUtil {
  public static Type translateClass(Class<?> clazz){
    if(clazz == null)
      throw new IllegalArgumentException();
    if(Integer.class.equals(clazz) || int.class.equals(clazz)){
      return new IntegerType();
    }else if(Long.class.equals(clazz) || long.class.equals(clazz)){
      return new LongType();
    }else if(Short.class.equals(clazz) || short.class.equals(clazz)){
      return new ShortType();
    }else if(Character.class.equals(clazz) || char.class.equals(clazz)){
View Full Code Here


    HibernateArtifact result;
    if (aid.getPk() == 0) {
      Query query = HibernateUtil.getCurrentSession().createQuery("FROM net.sf.collabreview.hibernate.HibernateArtifact " +
          "WHERE id.name = :name AND id.revision = :rev AND id.branch = :branch");
      query.setParameter("name", aid.getName(), new StringType());
      query.setParameter("rev", aid.getRevision(), new IntegerType());
      query.setParameter("branch", aid.getBranch(), new StringType());
      result = (HibernateArtifact) query.uniqueResult();
    } else {
      result = ((HibernateArtifact) HibernateUtil.getCurrentSession().get(HibernateArtifact.class, aid.getPk()));
    }
View Full Code Here


    try{
        Query _obj = this.getSession().createQuery(query.toString());

        _obj.setParameterList("grupo", lista, new IntegerType());
       
        if (nomeItemPesquisar != null && !nomeItemPesquisar.equals(Dominios.STRING_VAZIA)) {
          _obj.setString("nome", "%" + nomeItemPesquisar.toLowerCase() + "%");
        }
       
View Full Code Here

TOP

Related Classes of org.hibernate.type.IntegerType

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.