Hibernate ORM StringType - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM StringType class.

This code example shows how to use the following methods:
    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);
  } 
 
  @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);
Full Snippet Info
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
    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);
  } 
 
  @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));
Full Snippet Info
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 * 
 * @author <a href="mailto:dj@opennms.org">DJ Gregor</a> 
 * @version $Id: $ 
 */ 
public abstract class OnmsRestrictions { 
    private static final StringType STRING_TYPE = new StringType();
     
    /** 
     * Performs an iplike match on the ipAddr column of the current table. 
     * 
     * @param value iplike match 
     * @return SQL restriction for this iplike match 
     */ 
    public static Criterion ipLike(String value) {
        return Restrictions.sqlRestriction("iplike({alias}.ipAddr, ?)", value, STRING_TYPE);
    } 
} 
Full Snippet Info
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 
    private Method identifierMethod;
 
    private Method valueOfMethod;
 
    private final StringType type = new StringType();
 
    private int[] sqlTypes;
 
    @Override 
    public void setParameterValues(final Properties parameters) {
        final String enumClassName = parameters.getProperty("enumClass");
        try { 
            enumClass = Class.forName(enumClassName).asSubclass(Enum.class);
        } catch (final ClassNotFoundException cfne) {
            final String message = "Enum class not found";
            throw new HibernateException(message, cfne);
        } 
        final String identifierMethodName = parameters.getProperty("identifierMethod", DEFAULT_IDENTIFIER_METHOD_NAME);
        try { 
Full Snippet Info
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 * A {@link StringType} which implemenets the {@link VersionType} contract and thus supports optimistic locking done by 
 * the datastore. 
 * 
 * @author Gunnar Morling 
 */ 
public class CouchDBStringType extends StringType implements VersionType<String> { 
 
	@Override 
	public String seed(SessionImplementor session) { 
		return null; 
	} 
 
	@Override 
	public String next(String current, SessionImplementor session) { 
		return current; 
	} 
 
	@Override 
	public Comparator<String> getComparator() { 
		return ComparableComparator.INSTANCE; 
Full Snippet Info
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
     */ 
    @SuppressWarnings("unchecked") 
    public List<ServiceType> findByName(Collection<String> names) {
        String sql = "from ServiceType where name in (:names)";
        return getSession().createQuery(sql)
            .setParameterList("names", names, new StringType())
            .list(); 
    } 
 
    public ServiceType findByName(String name) {
        String sql = "from ServiceType where sortName=?";
        return (ServiceType) getSession().createQuery(sql).setString(0, name.toUpperCase())
            .setCacheable(true).setCacheRegion("ServiceType.findByName").uniqueResult(); 
    } 
 
    @SuppressWarnings("unchecked") 
    public Collection<ServiceType> findByPlugin(String plugin) {
        return createCriteria().add(Restrictions.eq("plugin", plugin)).addOrder(
            Order.asc("sortName")).list();
    } 
Full Snippet Info
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 * 
 * @author Gunnar Morling 
 */ 
public class StringAsObjectIdType extends StringType { 
 
	public StringAsObjectIdType() { 
	} 
 
	@Override 
	public String getName() { 
		return "string_objectid"; 
	} 
 
	@Override 
	public String[] getRegistrationKeys() { 
		return new String[]{ "objectid" }; 
	} 
} 
Full Snippet Info
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: getName
This code example shows how to use the following methods:
     */ 
    @SuppressWarnings("unchecked") 
    public List<ServerType> findByName(Collection<String> names) {
        String sql = "from ServerType where name in (:names)";
        return getSession().createQuery(sql)
            .setParameterList("names", names, new StringType())
            .list(); 
    } 
 
    public ServerType findByName(String name) {
        String sql = "from ServerType where sortName=?";
        return (ServerType) getSession().createQuery(sql).setString(0, name.toUpperCase())
            .uniqueResult(); 
    } 
 
    public ServerType findByNameAndPlugin(String name, String plugin) {
        String sql = "from ServerType where sortName=? and plugin=?";
        return (ServerType) getSession().createQuery(sql).setString(0, name.toUpperCase())
            .setString(1, plugin).uniqueResult();
    } 
Full Snippet Info
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
     */ 
    @SuppressWarnings("unchecked") 
    public List<AppdefResourceType> findByName(Collection<String> names) { 
        String sql = "from PlatformType where name in (:names)"; 
        return getSession().createQuery(sql) 
            .setParameterList("names", names, new StringType()) 
            .list(); 
    } 
 
    public PlatformType findByName(String name) { 
        String sql = "from PlatformType where name=?"; 
        return (PlatformType) getSession().createQuery(sql).setString(0, name).uniqueResult(); 
    } 
 
    @SuppressWarnings("unchecked") 
    public Collection<PlatformType> findByPlugin(String plugin) { 
        String sql = "from PlatformType where plugin=?"; 
        return getSession().createQuery(sql).setString(0, plugin).list(); 
    } 
} 
Full Snippet Info
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Hibernate ORM StringType Methods: