Hibernate ORM AbstractStandardBasicType - 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 AbstractStandardBasicType class.

This code example shows how to use the following methods:get
    public Class<? extends Enum> returnedClass() {
        return enumClass;
    } 
 
    public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
        Object identifier = type.get(rs, names[0], null);
        if (rs.wasNull()) {
            return null; 
        } 
 
        try { 
            return valueOfMethod.invoke(enumClass, new Object[] {identifier});
        } 
        catch (Exception e) {
            throw new HibernateException("Exception while invoking valueOf method '" + valueOfMethod.getName() + "' of " +
                    "enumeration class '" + enumClass + "'", e);
        } 
    } 
 
    public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
4
CodeRank
This code example shows how to use the following methods:getJavaTypeDescriptor
 
    public abstract void doNullSafeSet(PreparedStatement preparedStatement, Object value, int index, SessionImplementor session) throws SQLException, IllegalArgumentException, IllegalAccessException, InvocationTargetException;
 
    @SuppressWarnings({ "rawtypes", "unchecked" }) 
    public String objectToSQLString(Object object) {
    	final JavaTypeDescriptor desc = type.getJavaTypeDescriptor();
    	return desc.toString(object);
    } 
 
    @SuppressWarnings({ "rawtypes", "unchecked" }) 
    public String toXMLString(Object object) {
    	final JavaTypeDescriptor desc = type.getJavaTypeDescriptor();
    	return desc.toString(object);
    } 
 
    public Object fromXMLString(String string) {
		return type.fromString(string);
    } 
} 
4
CodeRank
This code example shows how to use the following methods:get
    } 
 
    @Override 
    public Object nullSafeGet(final ResultSet rs, final String[] names, final SessionImplementor session, final Object owner) throws HibernateException,
            SQLException {
        final Object identifier = type.get(rs, names[0], session);
        if (identifier == null) { 
            return null; 
        } 
        try { 
            return valueOfMethod.invoke(null, new Object[] { identifier });
        } catch (final Exception e) {
            final StringBuilder stb = new StringBuilder("Exception while invoking valueOf method '");
            stb.append(valueOfMethod.getName());
            stb.append("' of enumeration class '");
            stb.append(enumClass);
            stb.append('\'');
            throw new HibernateException(stb.toString(), e);
        } 
    } 
4
CodeRank
This code example shows how to use the following methods:nullSafeGet
	} 
 
	@Override 
	public Object nullSafeGet(final ResultSet rs, final String[] names, final SessionImplementor sessionImplementor, final Object owner) throws HibernateException,
			SQLException {
		final Object identifier = type.nullSafeGet(rs, names[0], sessionImplementor);
		if (identifier == null) { 
			return null; 
		} 
 
		try { 
			return valueOfMethod.invoke(enumClass, new Object[] { identifier });
		} catch (final Exception e) {
			throw new HibernateException("Exception while invoking valueOf method '" + valueOfMethod.getName()
					+ "' of " + "enumeration class '" + enumClass + "'", e);
		} 
	} 
 
	@Override 
	public void nullSafeSet(final PreparedStatement st, final Object value, final int index, final SessionImplementor sessionImplementor) throws HibernateException,
3
CodeRank
This code example shows how to use the following methods:get
    } 
 
    @Override 
    public Object nullSafeGet(final ResultSet rs, final String[] names, final SessionImplementor session, final Object owner) throws HibernateException,
            SQLException {
        final Object identifier = type.get(rs, names[0], session);
        if (identifier == null) { 
            return null; 
        } 
        try { 
            return valueOfMethod.invoke(enumClass, new Object[] { identifier });
        } catch (final Exception e) {
            final StringBuilder stb = new StringBuilder("Exception while invoking valueOf method '");
            stb.append(valueOfMethod.getName());
            stb.append("' of enumeration class '");
            stb.append(enumClass);
            stb.append('\'');
            throw new HibernateException(stb.toString(), e);
        } 
    } 
4
CodeRank
See Code Examples for Hibernate ORM AbstractStandardBasicType Methods: