1.hibernate search 已经有4.0.0.Final 版本了
正好手头再做新的项目,升级下
一升级,发现代码很多错误,发现有两个类发生了重要的变化
第一个是 枚举org.hibernate.search.annotations.Index
4.0.0以前的版本 里面的枚举是这样的
/**
* Do not index the field value. This field can thus not be searched,
* but one can still access its contents provided it is
* {@link Store stored}.
*/
NO,
/**
* Index the field's value so it can be searched. An Analyzer will be used
* to tokenize and possibly further normalize the text before its
* terms will be stored in the index. This is useful for common text.
*/
TOKENIZED,
/**
* Index the field's value without using an Analyzer, so it can be searched.
* As no analyzer is used the value will be stored as a single term. This is
* useful for unique Ids like product numbers.
*/
UN_TOKENIZED,
/**
* Index the field's value without an Analyzer, and disable
* the storing of norms. No norms means that index-time boosting
* and field length normalization will be disabled. The benefit is
* less memory usage as norms take up one byte per indexed field
* for every document in the index.
*/
NO_NORMS
4.0.0里面的这个枚举是这样的
/**
* Index the field value.
*/
YES,
/**
* Do not index the field value. This field can thus not be searched,
* but one can still access its contents provided it is
* {@link Store stored}.
*/
NO
简洁了许多
所以 以前的 org.hibernate.search.annotations.Index.TOKENIZED 代码 要改成 org.hibernate.search.annotations.Index.YES
2.顺带还发现 @org.hibernate.annotations.Entity 这个annotation 已经@Deprecated了 ,而且javadoc 里面写得很清楚 To be removed in 4.1,呵呵人家已经和你打招呼了
所以 我们原来的乐观锁@org.hibernate.annotations.Entity(optimisticLock = OptimisticLockType.VERSION) 要改成 @OptimisticLocking(type = OptimisticLockType.VERSION),这个annotation 默认采用的是 OptimisticLockType type() default OptimisticLockType.VERSION;
所以,如果你的乐观锁是采用version column 那么 可以简写成 @OptimisticLocking
要改成
第二,原来的
org.hibernate.search.filter.CachingWrapperFilter 已经该成 org.hibernate.search.filter.impl.CachingWrapperFilter;
3.spring 从3.0.6 升级到3.1.0
发现
private UrlMatcher urlMatcher = new AntUrlPathMatcher();;
UrlMatcher 和 AntUrlPathMatcher 这两个类不见了
org.springframework.security.web.util.AntUrlPathMatcher;
import org.springframework.security.web.util.UrlMatcher;
取而代之的是
import org.springframework.util.AntPathMatcher;
import org.springframework.util.PathMatcher;
而且写法也不一样了
要这么写
FilterInvocation filterInvocation = (FilterInvocation) object;
HttpServletRequest request = filterInvocation.getHttpRequest();
RequestMatcher requestMatcher = new AntPathRequestMatcher(resURL);
requestMatcher.matches(request)
在这里,如果你们的项目有成熟 的架构,我不建议各位去升级
要改动的地方很多
相关推荐
hibernate-release-4.0.0.Final.zip
netty-all-4.0.0.Final-javadoc,官方最新版本的netty文档
hibernate-tools-4.0.0.jar官网下载
hibernate-validator-4.0.0.Beta1.jar
hibernate-validator-4.0.0.CR1-dist.zip
hibernate-c3p0-4.0.0.Final
hibernate-release-4.0.0.CR2.zip
hibernate-release-4.0.0 hibernate-release-4.0.0.CR5.zip
Hibernate4.0.0 API CHM格式帮助文档
hibernate-release-4.0.0.Beta1.zip
hibernate-release-4.0.0.CR4.rar 完整版 jar文件和文档都有
hibernate-release-4.0.0.CR1.zip
hibernate-release-4.0.0.CR6
hibernate-release-4.0.0.CR4.rar文档和api,我传不了那么大的,所以把文档和jar文件分开了
hibernate-release-4.0.0.CR4.rar里面的jar文件,文档我也有,可以直接搜的到,我传不了那么大的
这是一个多个压缩包,必须要将sts-4.0.0.RELEASE.7z.001和4.0.0.RELEASE.7z.002和4.0.0.RELEASE.7z.003全部下载放在一起,使用7z解压才行。此链接为sts-4.0.0.RELEASE.7z.001,4.0.0.RELEASE.7z.002和4.0.0.RELEASE....
spring-jdbc-4.0.0.RELEASE-sources.jar
commons-logging-1.1.3,spring-test-4.0.0.RELEASE,spring-aop-4.0.0.RELEASE,spring-aspects-4.0.0.RELEASE
richfaces-components-api-4.0.0.Final-sources.jar
spring-jdbc-4.0.0.RELEASE-javadoc.jar