@Override @SuppressWarnings({ "unchecked" }) public final void nullSafeSet( PreparedStatement st, Object value, int index, final SharedSessionContractImplementor session) throws SQLException { nullSafeSet( st, value, index, (WrapperOptions) session ); }
public AdaptedImmutableType(AbstractStandardBasicType<T> baseMutableType) { super( baseMutableType.getSqlTypeDescriptor(), baseMutableType.getJavaTypeDescriptor() ); this.baseMutableType = baseMutableType; }
@Override public String[] getRegistrationKeys() { return registerUnderJavaType() ? new String[] { getName(), javaTypeDescriptor.getJavaType().getName() } : new String[] { getName() }; }
@Override public final Object nullSafeGet(ResultSet rs, String name, SharedSessionContractImplementor session, Object owner) throws SQLException { return nullSafeGet( rs, name, session ); }
public String getName() { return "imm_" + baseMutableType.getName(); } }
@Override public T fromStringValue(String xml) throws HibernateException { return fromString( xml ); }
private void dump(PersistentClass entityBinding, TheEntity theEntity) { final Iterator propertyBindingIterator = entityBinding.getPropertyClosureIterator(); while ( propertyBindingIterator.hasNext() ) { final Property propertyBinding = (Property) propertyBindingIterator.next(); final JavaTypeDescriptor javaTypeDescriptor = ( (AbstractStandardBasicType) propertyBinding.getType() ).getJavaTypeDescriptor(); System.out.println( String.format( "%s (%s) -> %s", propertyBinding.getName(), javaTypeDescriptor.getJavaType().getSimpleName(), javaTypeDescriptor.toString( propertyBinding.getGetter( TheEntity.class ).get( theEntity ) ) ) ); } }
@SuppressWarnings({ "unchecked", "rawtypes" }) static void replaceJavaTypeDescriptor(AbstractStandardBasicType<?> abstractStandardBasicType) { JavaTypeDescriptor<?> javaTypeDescriptor = abstractStandardBasicType.getJavaTypeDescriptor(); if (javaTypeDescriptor != null && !(javaTypeDescriptor instanceof WrapperJavaTypeDescriptor)) { abstractStandardBasicType.setJavaTypeDescriptor((JavaTypeDescriptor)new WrapperJavaTypeDescriptor(javaTypeDescriptor)); } }
@Override @SuppressWarnings({ "unchecked" }) public final Object deepCopy(Object value, SessionFactoryImplementor factory) { return deepCopy( (T) value ); }
@Override public Size[] defaultSizes(Mapping mapping) throws MappingException { return new Size[] { getDefaultSize() }; }
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); } }
@Override public final Object nullSafeGet( ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws SQLException { return nullSafeGet( rs, names[0], session ); }
public String getName() { return "imm_" + baseMutableType.getName(); } }
public T fromStringValue(String xml) throws HibernateException { return fromString( xml ); }
@SuppressWarnings({ "unchecked" }) public final Object deepCopy(Object value, SessionFactoryImplementor factory) { return deepCopy( (T) value ); }
@Override public Size[] defaultSizes(Mapping mapping) throws MappingException { return new Size[] { getDefaultSize() }; }
@Override public Object nullSafeGet(final ResultSet rs, final String[] names, final SharedSessionContractImplementor ssci, final Object owner) throws HibernateException, SQLException { Object identifier = type.get(rs, names[0], ssci); 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); } }
@Override public void nullSafeSet(CallableStatement st, Object value, String name, SharedSessionContractImplementor session) throws SQLException { nullSafeSet( st, value, name, (WrapperOptions) session ); }