hibernate中使用Criteria查询怎么删除重复记录啊 15
比如我想查询name不同的所有记录Criteriacriteria=session.createCriteria(TVendor.class);criteria.add(...
比如我想查询name不同的所有记录
Criteria criteria=session.createCriteria(TVendor.class);
criteria.add(Restrictons.eq("name",1));
.......
......
List a=(List)criteria.uniqueResult();
或者
criteria.setResultTransformer(criteria.DISTINCT_ROOT_ENTITY);
都不能解决问题啊
哪位大哥指点一把迷津^_^ 展开
Criteria criteria=session.createCriteria(TVendor.class);
criteria.add(Restrictons.eq("name",1));
.......
......
List a=(List)criteria.uniqueResult();
或者
criteria.setResultTransformer(criteria.DISTINCT_ROOT_ENTITY);
都不能解决问题啊
哪位大哥指点一把迷津^_^ 展开
1个回答
展开全部
将这样修改
Hibernate.property:
hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'
hibernate.dialect net.sf.hibernate.dialect.Oracle9Dialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username robert
hibernate.connection.password a
hibernate.connection.url jdbc:oracle:thin:@888-88:1521:DBName
hibernate.connection.pool_size 1
hibernate.proxool.pool_alias pool1
hibernate.jdbc.batch_size 0
hibernate.jdbc.use_streams_for_binary true
hibernate.max_fetch_depth 1
hibernate.cache.use_query_cache true
hibernate.cache.provider_class net.sf.hibernate.cache.HashtableCacheProvider
Hibernate.property:
hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'
hibernate.dialect net.sf.hibernate.dialect.Oracle9Dialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username robert
hibernate.connection.password a
hibernate.connection.url jdbc:oracle:thin:@888-88:1521:DBName
hibernate.connection.pool_size 1
hibernate.proxool.pool_alias pool1
hibernate.jdbc.batch_size 0
hibernate.jdbc.use_streams_for_binary true
hibernate.max_fetch_depth 1
hibernate.cache.use_query_cache true
hibernate.cache.provider_class net.sf.hibernate.cache.HashtableCacheProvider
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询