예제 #1
0
 public Type type(Class<Type> typeClass, Properties parameters) {
   try {
     Type type = typeClass.newInstance();
     injectParameters(type, parameters);
     return type;
   } catch (Exception e) {
     throw new MappingException("Could not instantiate Type: " + typeClass.getName(), e);
   }
 }
예제 #2
0
 /** @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);
   }
 }
예제 #3
0
 /** @deprecated Only for use temporary use by {@link org.hibernate.Hibernate} */
 @Deprecated
 @SuppressWarnings({"JavaDoc"})
 public static CompositeCustomType customComponent(
     Class<CompositeUserType> typeClass, Properties parameters, TypeScope scope) {
   try {
     CompositeUserType userType = typeClass.newInstance();
     injectParameters(userType, parameters);
     return new CompositeCustomType(userType);
   } catch (Exception e) {
     throw new MappingException("Unable to instantiate custom type: " + typeClass.getName(), e);
   }
 }
예제 #4
0
 public CollectionType customCollection(
     String typeName,
     Properties typeParameters,
     String role,
     String propertyRef,
     boolean embedded) {
   Class typeClass;
   try {
     typeClass = ReflectHelper.classForName(typeName);
   } catch (ClassNotFoundException cnfe) {
     throw new MappingException("user collection type class not found: " + typeName, cnfe);
   }
   CustomCollectionType result =
       new CustomCollectionType(typeScope, typeClass, role, propertyRef, embedded);
   if (typeParameters != null) {
     injectParameters(result.getUserType(), typeParameters);
   }
   return result;
 }