本文整理汇总了Java中org.hibernate.usertype.EnhancedUserType类的典型用法代码示例。如果您正苦于以下问题:Java EnhancedUserType类的具体用法?Java EnhancedUserType怎么用?Java EnhancedUserType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EnhancedUserType类属于org.hibernate.usertype包,在下文中一共展示了EnhancedUserType类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fromStringValue
import org.hibernate.usertype.EnhancedUserType; //导入依赖的package包/类
@Override
public Object fromStringValue(String string) throws HibernateException {
if ( StringRepresentableType.class.isInstance( userType ) ) {
return ( (StringRepresentableType) userType ).fromStringValue( string );
}
if ( EnhancedUserType.class.isInstance( userType ) ) {
//noinspection deprecation
return ( (EnhancedUserType) userType ).fromXMLString( string );
}
throw new HibernateException(
String.format(
"Could not process #fromStringValue, UserType class [%s] did not implement %s or %s",
name,
StringRepresentableType.class.getName(),
EnhancedUserType.class.getName()
)
);
}
示例2: toString
import org.hibernate.usertype.EnhancedUserType; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public String toString(Object value) throws HibernateException {
if ( StringRepresentableType.class.isInstance( userType ) ) {
return ( (StringRepresentableType) userType ).toString( value );
}
if ( value == null ) {
return null;
}
if ( EnhancedUserType.class.isInstance( userType ) ) {
//noinspection deprecation
return ( (EnhancedUserType) userType ).toXMLString( value );
}
return value.toString();
}
示例3: toXMLString
import org.hibernate.usertype.EnhancedUserType; //导入依赖的package包/类
public String toXMLString(Object value, SessionFactoryImplementor factory) {
if (value==null) return null;
if (userType instanceof EnhancedUserType) {
return ( (EnhancedUserType) userType ).toXMLString(value);
}
else {
return value.toString();
}
}
示例4: objectToSQLString
import org.hibernate.usertype.EnhancedUserType; //导入依赖的package包/类
public String objectToSQLString(Object value, Dialect dialect) throws Exception {
return ( (EnhancedUserType) userType ).objectToSQLString(value);
}
示例5: fromXMLString
import org.hibernate.usertype.EnhancedUserType; //导入依赖的package包/类
public Object fromXMLString(String xml, Mapping factory) {
return ( (EnhancedUserType) userType ).fromXMLString(xml);
}
示例6: stringToObject
import org.hibernate.usertype.EnhancedUserType; //导入依赖的package包/类
public Object stringToObject(String xml) {
return ( (EnhancedUserType) userType ).fromXMLString(xml);
}