本文整理汇总了Java中org.hibernate.usertype.UserType.sqlTypes方法的典型用法代码示例。如果您正苦于以下问题:Java UserType.sqlTypes方法的具体用法?Java UserType.sqlTypes怎么用?Java UserType.sqlTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.usertype.UserType
的用法示例。
在下文中一共展示了UserType.sqlTypes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CustomType
import org.hibernate.usertype.UserType; //导入方法依赖的package包/类
public CustomType(UserType userType, String[] registrationKeys) throws MappingException {
this.userType = userType;
this.name = userType.getClass().getName();
this.types = userType.sqlTypes();
this.dictatedSizes = Sized.class.isInstance( userType )
? ( (Sized) userType ).dictatedSizes()
: new Size[ types.length ];
this.defaultSizes = Sized.class.isInstance( userType )
? ( (Sized) userType ).defaultSizes()
: new Size[ types.length ];
this.customLogging = LoggableUserType.class.isInstance( userType );
this.registrationKeys = registrationKeys;
}
示例2: CustomType
import org.hibernate.usertype.UserType; //导入方法依赖的package包/类
public CustomType(Class userTypeClass, Properties parameters) throws MappingException {
if ( !UserType.class.isAssignableFrom( userTypeClass ) ) {
throw new MappingException(
"Custom type does not implement UserType: " +
userTypeClass.getName()
);
}
name = userTypeClass.getName();
try {
userType = ( UserType ) userTypeClass.newInstance();
}
catch ( InstantiationException ie ) {
throw new MappingException(
"Cannot instantiate custom type: " +
userTypeClass.getName()
);
}
catch ( IllegalAccessException iae ) {
throw new MappingException(
"IllegalAccessException trying to instantiate custom type: " +
userTypeClass.getName()
);
}
TypeFactory.injectParameters( userType, parameters );
types = userType.sqlTypes();
customLogging = LoggableUserType.class.isAssignableFrom( userTypeClass );
}