public BasicTypeRegistration(UserType type, String[] keys) { this( new CustomType( type, keys ), keys ); }
public Configuration registerTypeOverride(UserType type, String[] keys) { basicTypes.add( new CustomType( type, keys ) ); return this; }
public void register(UserType type, String[] keys) { register( new CustomType( type, keys ) ); }
/** * @deprecated Only for use temporary use by {@link org.hibernate.Hibernate} */ @Deprecated public static CustomType custom(Class<UserType> typeClass, Properties parameters, TypeScope scope) { try { UserType userType = typeClass.newInstance(); injectParameters( userType, parameters ); return new CustomType( userType ); } catch (Exception e) { throw new MappingException( "Unable to instantiate custom type: " + typeClass.getName(), e ); } }
public CustomType custom(Class<UserType> typeClass, Properties parameters) { try { UserType userType = typeClass.newInstance(); if ( TypeConfigurationAware.class.isInstance( userType ) ) { ( (TypeConfigurationAware) userType ).setTypeConfiguration( typeConfiguration ); } injectParameters( userType, parameters ); return new CustomType( userType ); } catch (Exception e) { throw new MappingException( "Unable to instantiate custom type: " + typeClass.getName(), e ); } }
public Query toQuery(Session session) { final StringBuilder querySb = new StringBuilder(); final Map<String, Object> queryParamValues = new HashMap<>(); build( querySb, queryParamValues ); final Query query = session.createQuery( querySb.toString() ); for ( Map.Entry<String, Object> paramValue : queryParamValues.entrySet() ) { if ( paramValue.getValue() instanceof RevisionType ) { // this is needed when the ClassicQueryTranslatorFactory is used query.setParameter( paramValue.getKey(), paramValue.getValue(), new CustomType( new RevisionTypeType() ) ); } else { query.setParameter( paramValue.getKey(), paramValue.getValue() ); } } return query; }
returnTypeName = getNVarcharType(); } else { return new CustomType(columnTypeString,0,2);
public void register(UserType type, String[] keys) { register( new CustomType( type, keys ) ); }
public void register(UserType type, String[] keys) { register( new CustomType( type, keys ) ); }
/** * A Hibernate parameterizable custom type. * * @param userTypeClass a class that implements <tt>UserType and ParameterizableType</tt> * @param parameters the parameters as a collection of name/value pairs */ public static Type custom(Class userTypeClass, Properties parameters) throws HibernateException { if ( CompositeUserType.class.isAssignableFrom( userTypeClass ) ) { CompositeCustomType type = new CompositeCustomType( userTypeClass, parameters ); return type; } else { CustomType type = new CustomType( userTypeClass, parameters ); return type; } }
/** * @deprecated Only for use temporary use by {@link org.hibernate.Hibernate} */ @Deprecated public static CustomType custom(Class<UserType> typeClass, Properties parameters, TypeScope scope) { try { UserType userType = typeClass.newInstance(); injectParameters( userType, parameters ); return new CustomType( userType ); } catch ( Exception e ) { throw new MappingException( "Unable to instantiate custom type: " + typeClass.getName(), e ); } }
/** * @deprecated Only for use temporary use by {@link org.hibernate.Hibernate} */ @Deprecated public static CustomType custom(Class<UserType> typeClass, Properties parameters, TypeScope scope) { try { UserType userType = typeClass.newInstance(); injectParameters( userType, parameters ); return new CustomType( userType ); } catch ( Exception e ) { throw new MappingException( "Unable to instantiate custom type: " + typeClass.getName(), e ); } }
private static org.hibernate.type.Type adaptCustomType(final net.sf.hibernate.type.CustomType type) { return new org.hibernate.type.CustomType( UserTypeV5Adapter.adapt(CustomTypeV2Reflection.getUserType(type))); } }
type = new CustomType( typeClass, parameters );
type = new CustomType( typeClass, parameters );
@Controller class MyController { public ModelAndView processSubmittedForm(@Valid MyObject myObject, BindingResult result) {..} @InitBinder public void initBinder (WebDataBinder binder) { binder.registerCustomEditor(MyObject.class, new CustomObjectEditor()); } } class CustomObjectEditor { @Override public void setAsText(String text) throws IllegalArgumentException { MyObject ob = new MyObject(); CustomType ct = new CustomType(); ct.setValue(text); ob.setCustomType(ct); super.setValue(ob); } }
return new org.hibernate.type.CustomType(new PersistentEnumUserType(type.getReturnedClass())); if (type instanceof net.sf.hibernate.type.ManyToOneType) return adaptManyToOneType(sessionFactory, (net.sf.hibernate.type.ManyToOneType) type);
Hibernate.INTEGER)); registerFunction("envelope", new StandardSQLFunction("ST_Envelope", new CustomType(new GeoDBGeometryUserType(), null))); registerFunction("astext", new StandardSQLFunction("ST_AsText", Hibernate.STRING)); Hibernate.DOUBLE)); registerFunction("buffer", new StandardSQLFunction("ST_Buffer", new CustomType(new GeoDBGeometryUserType(), null)));
CustomType type = new CustomType( userTypeClass, parameters ); return type;