Package org.hibernate.type

Examples of org.hibernate.type.StringType


    }else if(Double.class.equals(clazz) || double.class.equals(clazz)){
      return new DoubleType();
    }else if(Boolean.class.equals(clazz) || boolean.class.equals(clazz)){
      return new BooleanType();
    }else if(String.class.equals(clazz)){
      return new StringType();
    }else if(Date.class.equals(clazz)){
      return new TimestampType();
    }else if(Calendar.class.equals(clazz)){
      return new CalendarType();
    }else if(Locale.class.equals(clazz)){
View Full Code Here


  protected Artifact retrieve(ArtifactIdentifier aid) throws Exception {
    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()));
    }
    finishInstantiation(result);
View Full Code Here

    HibernateUtil.closeSession();
  }

  public Artifact getLatestForName(String name, String branch) {
    Query query = HibernateUtil.getCurrentSession().createQuery("FROM HibernateArtifact WHERE id.name=:name AND id.branch=:branch AND id.revision=(SELECT MAX(revision) FROM ArtifactIdentifier WHERE name=:name AND branch=:branch)");
    query.setParameter("name", name, new StringType());
    query.setParameter("branch", branch, new StringType());
    HibernateArtifact artifact = (HibernateArtifact) query.uniqueResult();
    try {
      finishInstantiation(artifact);
    } catch (Exception e) {
      logger.error("Problem when loading latestForName(" + name + "," + branch + ")");
View Full Code Here

    return nullSafeGet(resultSet, names[0]);
  }

  @SuppressWarnings("deprecation")
  public Object nullSafeGet(ResultSet resultSet, String name) throws SQLException {
    String value = (String) (new StringType()).nullSafeGet(resultSet, name);
    if (value == null) {
      return null;
    }
    return ObjectId.parse(value);
  }
View Full Code Here

  @SuppressWarnings("deprecation")
  public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException {
    if (value == null) {
      s_logger.debug("ObjectId -> String : NULL -> NULL");
      (new StringType()).nullSafeSet(preparedStatement, null, index);
    } else {
      s_logger.debug("ObjectId -> String : {}   ->  {}", value, ObjectId.parse((String) value));
      (new StringType()).nullSafeSet(preparedStatement, ObjectId.parse((String) value), index);
    }
  }
View Full Code Here

    return nullSafeGet(resultSet, names[0]);
  }

  @SuppressWarnings("deprecation")
  public Object nullSafeGet(ResultSet resultSet, String name) throws SQLException {
    String value = (String) (new StringType()).nullSafeGet(resultSet, name);
    if (value == null) {
      return null;
    }
    return VersionCorrection.parse(value);
  }
View Full Code Here

  @SuppressWarnings("deprecation")
  public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException {
    if (value == null) {
      s_logger.debug("VersionCorrection -> String : NULL -> NULL");
      (new StringType()).nullSafeSet(preparedStatement, null, index);
    } else {
      s_logger.debug("VersionCorrection -> String : {}   ->  {}", value, value);
      (new StringType()).nullSafeSet(preparedStatement, value.toString(), index);
    }
  }
View Full Code Here

    return nullSafeGet(resultSet, names[0]);
  }

  @SuppressWarnings("deprecation")
  public Object nullSafeGet(ResultSet resultSet, String name) throws SQLException {
    String value = (String) (new StringType()).nullSafeGet(resultSet, name);
    if (value == null) {
      return null;
    }
    return UniqueId.parse(value);
  }
View Full Code Here

  @SuppressWarnings("deprecation")
  public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException {

    if (value == null) {
      s_logger.debug("UniqueId -> String : NULL -> NULL");
      (new StringType()).nullSafeSet(preparedStatement, null, index);
    } else {
      s_logger.debug("UniqueId -> String : {}   ->  {}", value, UniqueId.parse((String) value));
      (new StringType()).nullSafeSet(preparedStatement, UniqueId.parse((String) value), index);
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.type.StringType

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.