本文整理汇总了Java中com.thoughtworks.xstream.hibernate.mapper.HibernateMapper类的典型用法代码示例。如果您正苦于以下问题:Java HibernateMapper类的具体用法?Java HibernateMapper怎么用?Java HibernateMapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HibernateMapper类属于com.thoughtworks.xstream.hibernate.mapper包,在下文中一共展示了HibernateMapper类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCloner
import com.thoughtworks.xstream.hibernate.mapper.HibernateMapper; //导入依赖的package包/类
@Override
public <T> Function<T, T> createCloner(ClassLoader classLoader)
{
final XStream xstream = new XStream() {
@Override
protected MapperWrapper wrapMapper(MapperWrapper next) {
return new HibernateMapper(next);
}
};
xstream.setClassLoader(classLoader);
xstream.autodetectAnnotations(true);
xstream.registerConverter(new HibernateProxyConverter());
xstream.registerConverter(new HibernatePersistentCollectionConverter(xstream.getMapper()));
xstream.registerConverter(new HibernatePersistentMapConverter(xstream.getMapper()));
xstream.registerConverter(new HibernatePersistentSortedMapConverter(xstream.getMapper()));
xstream.registerConverter(new HibernatePersistentSortedSetConverter(xstream.getMapper()));
return t -> (T) xstream.fromXML(xstream.toXML(t));
}
示例2: getXStream
import com.thoughtworks.xstream.hibernate.mapper.HibernateMapper; //导入依赖的package包/类
private synchronized XStream getXStream()
{
if( xstream == null )
{
xstream = new XmlServiceImpl.ExtXStream(getClass().getClassLoader()) {
@Override
protected MapperWrapper wrapMapper(MapperWrapper next) {
return new HibernateMapper(next);
}
};
xstream.registerConverter(new WorkflowNodeConverter());
xstream.registerConverter(new BaseEntityXmlConverter(registry));
xstream.registerConverter(new HibernateProxyConverter());
xstream.registerConverter(new HibernatePersistentCollectionConverter(xstream.getMapper()));
xstream.registerConverter(new HibernatePersistentMapConverter(xstream.getMapper()));
}
return xstream;
}
示例3: getXStream
import com.thoughtworks.xstream.hibernate.mapper.HibernateMapper; //导入依赖的package包/类
private synchronized XStream getXStream()
{
if( xstream == null )
{
xstream = new XmlServiceImpl.ExtXStream(getClass().getClassLoader()) {
@Override
protected MapperWrapper wrapMapper(MapperWrapper next) {
return new HibernateMapper(next);
}
};
xstream.registerConverter(new HibernateProxyConverter());
xstream.registerConverter(new HibernatePersistentCollectionConverter(xstream.getMapper()));
xstream.alias("com.tle.core.oauth.beans.OAuthToken", OAuthToken.class);
xstream.alias("com.tle.core.oauth.beans.OAuthClient", OAuthClient.class);
xstream.registerConverter(new ClientXStreamConverter());
}
return xstream;
}
示例4: createXStream
import com.thoughtworks.xstream.hibernate.mapper.HibernateMapper; //导入依赖的package包/类
protected XStream createXStream() {
final XStream xstream = new XStream() {
protected MapperWrapper wrapMapper(final MapperWrapper next) {
return new HibernateMapper(next);
}
};
xstream.registerConverter(new HibernateProxyConverter());
xstream.registerConverter(new HibernatePersistentCollectionConverter(xstream
.getMapper()));
xstream.registerConverter(new HibernatePersistentMapConverter(xstream.getMapper()));
xstream
.registerConverter(new HibernatePersistentSortedMapConverter(xstream.getMapper()));
xstream
.registerConverter(new HibernatePersistentSortedSetConverter(xstream.getMapper()));
return xstream;
}
示例5: getXStream
import com.thoughtworks.xstream.hibernate.mapper.HibernateMapper; //导入依赖的package包/类
private synchronized XStream getXStream()
{
if( xstream == null )
{
xstream = new XmlServiceImpl.ExtXStream(getClass().getClassLoader()) {
@Override
protected MapperWrapper wrapMapper(MapperWrapper next) {
return new HibernateMapper(next);
}
};
xstream.registerConverter(new WorkflowNodeConverter());
}
return xstream;
}
示例6: instanciateXstreamForHibernate
import com.thoughtworks.xstream.hibernate.mapper.HibernateMapper; //导入依赖的package包/类
public static XStream instanciateXstreamForHibernate() {
XStream xstream1 =new XStream() {
protected MapperWrapper wrapMapper(final MapperWrapper next) {
return new HibernateMapper(next);
}
};
xstream1.registerConverter(new HibernateProxyConverter());
xstream1.registerConverter(new HibernatePersistentCollectionConverter(xstream1.getMapper()));
xstream1.registerConverter(new HibernatePersistentMapConverter(xstream1.getMapper()));
xstream1.registerConverter(new HibernatePersistentSortedMapConverter(xstream1.getMapper()));
xstream1.registerConverter(new HibernatePersistentSortedSetConverter(xstream1.getMapper()));
return xstream1;
}