当前位置: 首页>>代码示例>>Java>>正文


Java EnhancedUserType类代码示例

本文整理汇总了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()
			)
	);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:CustomType.java

示例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();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:CustomType.java

示例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();
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:10,代码来源:CustomType.java

示例4: objectToSQLString

import org.hibernate.usertype.EnhancedUserType; //导入依赖的package包/类
public String objectToSQLString(Object value, Dialect dialect) throws Exception {
	return ( (EnhancedUserType) userType ).objectToSQLString(value);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:CustomType.java

示例5: fromXMLString

import org.hibernate.usertype.EnhancedUserType; //导入依赖的package包/类
public Object fromXMLString(String xml, Mapping factory) {
	return ( (EnhancedUserType) userType ).fromXMLString(xml);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:4,代码来源:CustomType.java

示例6: stringToObject

import org.hibernate.usertype.EnhancedUserType; //导入依赖的package包/类
public Object stringToObject(String xml) {
	return ( (EnhancedUserType) userType ).fromXMLString(xml);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:4,代码来源:CustomType.java


注:本文中的org.hibernate.usertype.EnhancedUserType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。