- 浏览: 886361 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (687)
- java (127)
- servlet (38)
- struts (16)
- spring (22)
- hibernate (40)
- javascript (58)
- jquery (18)
- tomcat (51)
- 设计模式 (6)
- EJB (13)
- jsp (3)
- oracle (29)
- RUP (2)
- ajax (3)
- java内存管理 (4)
- java线程 (12)
- socket (13)
- path (5)
- XML (10)
- swing (2)
- UML (1)
- JBPM (2)
- 开发笔记 (45)
- Note参考 (15)
- JAXB (4)
- Quartz (2)
- 乱码 (2)
- CSS (2)
- Exception (4)
- Tools (7)
- sqlserver (3)
- DWR (7)
- Struts2 (47)
- WebService (2)
- 问题解决收藏 (7)
- JBOSS (7)
- cache (10)
- easyUI (19)
- jQuery Plugin (11)
- FreeMarker (6)
- Eclipse (2)
- Compass (2)
- JPA (1)
- WebLogic (1)
- powerdesigner (1)
- mybatis (1)
最新评论
-
bugyun:
受教了,谢谢
java 正则表达式 过滤html标签 -
xiongxingxing_123:
学习了,感谢了
java 正则表达式 过滤html标签 -
wanmeinange:
那如果无状态的。对同一个任务并发控制怎么做?比如继承Quart ...
quartz中参数misfireThreshold的详解 -
fanjieshanghai:
...
XPath 元素及属性查找 -
tianhandigeng:
还是没明白
quartz中参数misfireThreshold的详解
经过三天的折腾,终于把Compass整合SSH搞定了,下边贴出源码,给正在学习的朋友,毕竟网上关于Compass的详细介绍还是太少了。
我用到的版本是struts2+spring 2.5 +hibernate 3.2+compass 2.2+Quartz 1.6
一、创建一张表,表名PRODUCT
CREATE TABLE "LICE"."PRODUCT"
( "PRODUCT_ID" VARCHAR2(40) NOT NULL ENABLE,
"PRODUCT_NAME" VARCHAR2(80),
"PRODUCT_PRICE" NUMBER(6,2),
"PRODUCT_BRAND" VARCHAR2(40),
"PRODUCT_DESC" VARCHAR2(200),
"VERSION" NUMBER(10,0),
PRIMARY KEY ("PRODUCT_ID")
)
二、PRODUCT表对应的实体类
package com.lice.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
import org.hibernate.annotations.GenericGenerator;
import org.compass.annotations.*;
@Entity
@Table(name = "PRODUCT", schema = "LICE")
@Searchable
public class Product implements java.io.Serializable {
// Fields
@SearchableId
private String productId;
@SearchableProperty(name="productName")
private String productName;
@SearchableProperty(name="productPrice")
private Double productPrice;
@SearchableProperty(name="productBrand")
private String productBrand;
@SearchableProperty(name="productDesc")
private String productDesc;
@SearchableProperty(name="version")
private Integer version;
// Constructors
public Product() {
}
public Product(String productName, Double productPrice,
String productBrand, String productDesc) {
this.productName = productName;
this.productPrice = productPrice;
this.productBrand = productBrand;
this.productDesc = productDesc;
}
// Property accessors
@GenericGenerator(name = "generator", strategy = "uuid.hex")
@Id
@GeneratedValue(generator = "generator")
@Column(name = "PRODUCT_ID", unique = true, nullable = false, length = 40)
public String getProductId() {
return this.productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
@Column(name = "PRODUCT_NAME", length = 80)
public String getProductName() {
return this.productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
@Column(name = "PRODUCT_PRICE", precision = 6)
public Double getProductPrice() {
return this.productPrice;
}
public void setProductPrice(Double productPrice) {
this.productPrice = productPrice;
}
@Column(name = "PRODUCT_BRAND", length = 40)
public String getProductBrand() {
return this.productBrand;
}
public void setProductBrand(String productBrand) {
this.productBrand = productBrand;
}
@Column(name = "PRODUCT_DESC", length = 200)
public String getProductDesc() {
return this.productDesc;
}
public void setProductDesc(String productDesc) {
this.productDesc = productDesc;
}
@Version
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
}
注意如果要用hibernate查询,model里必须加上@SearchableProperty(name="XXXX")这种注释。
三、对象的DAO和实现类
import java.util.List;
import com.lice.model.Product;
public interface ProductDao {
public void create(Product p);
public Product getProduct(String id);
public List getProducts();
public void update(Product product);
public void remove(String id);
}
package com.lice.dao.hibernate;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.lice.dao.ProductDao;
import com.lice.model.Product;
public class ProductDaoHibernate extends HibernateDaoSupport implements ProductDao {
public void create(Product p) {
getHibernateTemplate().save(p);
}
public Product getProduct(String id) {
return (Product)getHibernateTemplate().get(Product.class, id);
}
public List getProducts() {
return getHibernateTemplate().find("from Product order by id desc");
}
public void remove(String id) {
getHibernateTemplate().delete(getProduct(id));
}
public void update(Product product) {
getHibernateTemplate().saveOrUpdate(product);
}
}
四、对应的Service和实现类
import java.util.List;
import com.lice.model.Product;
public interface ProductManager {
public void insertProduct(Product p);
public Product findProdcut(String id);
}
package com.lice.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.lice.dao.ProductDao;
import com.lice.model.Product;
import com.lice.service.ProductManager;
public class ProductManagerImpl implements ProductManager {
private ProductDao productDao;
public Product findProdcut(String id) {
return productDao.getProduct(id);
}
public void insertProduct(Product p) {
productDao.create(p);
}
public ProductDao getProductDao() {
return productDao;
}
public void setProductDao(ProductDao productDao) {
this.productDao = productDao;
}
}
五、对应的action
package com.lice.action;
import java.util.List;
import org.apache.struts2.ServletActionContext;
import com.lice.model.Product;
import com.lice.service.CompassManager;
import com.lice.service.ProductManager;
import com.opensymphony.xwork2.ActionSupport;
public class ProductAction extends ActionSupport{
private static final long serialVersionUID = -2189044281576376151L;
private ProductManager productManager;
private CompassManager compassManager;
private Product product;
private String queryString;
public String insert(){
productManager.insertProduct(product);
return SUCCESS;
}
public String search(){
List results=compassManager.productCompass(queryString);
System.out.println(results.size());
ServletActionContext.getRequest().setAttribute("searchresults", results);
return SUCCESS;
}
public ProductManager getProductManager() {
return productManager;
}
public void setProductManager(ProductManager productManager) {
this.productManager = productManager;
}
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public String getQueryString() {
return queryString;
}
public void setQueryString(String queryString) {
this.queryString = queryString;
}
public CompassManager getCompassManager() {
return compassManager;
}
public void setCompassManager(CompassManager compassManager) {
this.compassManager = compassManager;
}
}
六、配置文件applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd" default-lazy-init="true">
<!-- load jdbc.properties -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
</list>
</property>
</bean>
<!-- 定义数据源的Bean ,给Hibernate的sessionFactory-->
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}"></property>
<property name="password" value="${jdbc.password}"></property>
<property name="maxActive" value="${jdbc.maxActive}"/>
<property name="maxWait" value="${jdbc.maxWait}"/>
<property name="poolPreparedStatements" value="${jdbc.poolPreparedStatements}"/>
<property name="defaultAutoCommit" value="${jdbc.defaultAutoCommit}"/>
<property name="logAbandoned" value="${jdbc.logAbandoned}"/>
<property name="removeAbandoned" value="${jdbc.removeAbandoned}"/>
<property name="removeAbandonedTimeout" value="${jdbc.removeAbandonedTimeout}"/>
</bean>
<!-- 定义Hibernate的sessionFactory,通过该Bean,可以获得Hibernate的Session-->
<!-- 如果hibernate用了annotation,这里必须用AnnotationSessionFactoryBean -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource"><ref bean="dataSource" /></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.jdbc.fetch_size">30</prop>
<prop key="hibernate.jdbc.batch_size">50</prop>
<prop key="hibernate.statement_cache.size">0</prop>
</props>
</property>
<property name="configLocation" value="classpath:hibernate.cfg.xml" />
</bean>
<bean name="productDao" class="com.lice.dao.hibernate.ProductDaoHibernate">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean name="productManager" class="com.lice.service.impl.ProductManagerImpl ">
<property name="productDao" ref="productDao"></property>
<property name="compassTemplate" ref="compassTemplate"></property>
</bean>
<bean id="compassManager" class="com.lice.service.impl.CompassManagerImpl">
<property name="compassTemplate" ref="compassTemplate"></property>
</bean>
<bean id="productBean" class="com.lice.action.ProductAction" scope="prototype">
<property name="productManager" ref="productManager"></property>
<property name="compassManager" ref="compassManager"></property>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
<!-- 配置事务特性,配置add、delete和update开始的方法,事务传播特性为required-->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
<!-- 配置那些类的方法进行事务管理,当前com.lice.service包中的子包、类中所有方法需要,还需要参考tx:advice的设置 -->
<aop:config>
<aop:pointcut id="allManagerMethod" expression="execution (* com.lice.service.*.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod"/>
</aop:config>
</beans>
七、配置文件applicationContext-compass.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-
beans-2.5.xsd"
default-lazy-init="true">
<!-- productMapping Mapping -->
<bean id="productMapping"
class="org.compass.gps.device.jdbc.mapping.ResultSetToResourceMapping">
<property name="alias"> <value>product</value></property>
<property name="indexUnMappedColumns"><value>false</value></property>
<property name="selectQuery">
<value>
select t.product_id as productId ,t.version as version,t.product_name as productName
,t.product_price as productPrice ,t.product_brand as productBrand
,t.product_desc as productDesc from product t
</value>
</property>
<property name="versionQuery">
<value>
select t.product_id as productId ,COALESCE(t.version, 0) as version from product t
</value>
</property>
<property name="idMappings">
<list>
<bean class="org.compass.gps.device.jdbc.mapping.IdColumnToPropertyMapping">
<property name="columnName"><value>productId</value></property>
<property name="propertyName"><value>productId</value></property>
<property name="columnNameForVersion"><value>t.product_id</value></property>
</bean>
</list>
</property>
<property name="dataMappings">
<list>
<bean class="org.compass.gps.device.jdbc.mapping.DataColumnToPropertyMapping">
<property name="columnName"><value>productName</value></property>
<property name="propertyName"><value>productName</value></property>
</bean>
<bean class="org.compass.gps.device.jdbc.mapping.DataColumnToPropertyMapping">
<property name="columnName"><value>productPrice</value></property>
<property name="propertyName"><value>productPrice</value></property>
</bean>
<bean class="org.compass.gps.device.jdbc.mapping.DataColumnToPropertyMapping">
<property name="columnName"><value>productBrand</value></property>
<property name="propertyName"><value>productBrand</value></property>
</bean>
<bean class="org.compass.gps.device.jdbc.mapping.DataColumnToPropertyMapping">
<property name="columnName"><value>productDesc</value></property>
<property name="propertyName"><value>productDesc</value></property>
</bean>
</list>
</property>
<property name="versionMappings">
<list>
<bean class="org.compass.gps.device.jdbc.mapping.VersionColumnMapping">
<property name="columnName"><value>version</value></property>
</bean>
</list>
</property>
</bean>
<bean id="productMappingResolver"
class="org.compass.gps.device.jdbc.ResultSetResourceMappingResolver">
<property name="mapping"><ref local="productMapping" /></property>
<property name="dataSource"><ref bean="dataSource" /></property>
</bean>
<bean id="compass" class="org.compass.spring.LocalCompassBean">
<property name="mappingResolvers">
<list>
<ref local="productMappingResolver" />
</list>
</property>
<property name="compassSettings">
<props>
<prop key="compass.engine.connection">target/compass</prop>
<prop key="compass.transaction.factory">
org.compass.spring.transaction.SpringSyncTransactionFactory
</prop>
<!-- 自定义分词 -->
<prop key="compass.engine.analyzer.MMAnalyzer.CustomAnalyzer">
net.paoding.analysis.analyzer.PaodingAnalyzer
</prop>
<prop key="compass.engine.analyzer.MMAnalyzer.CustomAnalyzer">
org.apache.lucene.annalysis.cn.SmartChineseAnalyzer
</prop>
<!-- 高亮关键字 -->
<prop key="compass.engine.highlighter.default.formatter.simple.pre">
<![CDATA[<font color="red"><b>]]>
</prop>
<prop key="compass.engine.highlighter.default.formatter.simple.post">
<![CDATA[</b></font>]]>
</prop>
</props>
</property>
<property name="transactionManager" ref="transactionManager" />
</bean>
<bean id="jdbcGpsDevice" class="org.compass.gps.device.jdbc.ResultSetJdbcGpsDevice">
<property name="name"><value>jdbcDevice</value></property>
<property name="dataSource"><ref bean="dataSource" /></property>
<!-- 同步更新索引 -->
<property name="mirrorDataChanges"><value>false</value></property>
<property name="saveSnapshotAfterMirror"><value>false</value></property>
<property name="mappings">
<list>
<ref local="productMapping" />
</list>
</property>
<property name="snapshotPersister">
<bean class="org.compass.gps.device.jdbc.snapshot.FSJdbcSnapshotPersister">
<property name="path" value="target/compass/snapshot" />
</bean>
</property>
</bean>
<bean id="scheduledJdbcGpsDevice" class="org.compass.gps.device.ScheduledMirrorGpsDevice">
<property name="gpsDevice" ref="jdbcGpsDevice" />
<property name="mirrorDataChanges" value="true"></property>
<property name="period">
<value>1800000</value>
</property>
</bean>
<bean id="hibernateGpsDevice" class="org.compass.gps.device.hibernate.HibernateGpsDevice">
<property name="name"><value>hibernateDevice</value></property>
<property name="sessionFactory" ref="sessionFactory" />
<!-- 操作数据库更新索引 -->
<property name="mirrorDataChanges"><value>true</value></property>
</bean>
<!-- 同步更新索引 -->
<bean id="compassGps" class="org.compass.gps.impl.SingleCompassGps">
<property name="compass" ref="compass" />
<property name="gpsDevices">
<list>
<ref bean="scheduledJdbcGpsDevice"/>
</list>
</property>
</bean>
<bean id="compassTemplate" class="org.compass.core.CompassTemplate">
<property name="compass" ref="compass" />
</bean>
</beans>
八、定时触发的Java文件和配置文件applicationContext-jobs.xml
package com.lice.task;
import org.apache.log4j.Logger;
import org.compass.gps.CompassGps;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;
public class CompassTask extends QuartzJobBean{
private Logger log = Logger.getLogger(CompassTask.class);
private CompassGps compassGps;
protected void executeInternal(JobExecutionContext context)
throws JobExecutionException {
long beginTime = System.currentTimeMillis();
log.info("--------compass job----------");
if (compassGps == null)
return;
log.info("-------- compass job start ---------");
compassGps.index();
log.info("-------- compass job end -------- :" + (System.currentTimeMillis() - beginTime));
}
public CompassGps getCompassGps() {
return compassGps;
}
public void setCompassGps(CompassGps compassGps) {
this.compassGps = compassGps;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- Quartz Scheduler, with pre-registered triggers -->
<!-- Will automatically start scheduling on context startup -->
<bean id="scheduler"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref local="compassTrigger" />
</list>
</property>
</bean>
<!-- 触发器-->
<bean id="compassTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<!-- 装配将要被调度的工作 -->
<property name="jobDetail" ref="compassJob" />
<!-- 延迟工作的第一次执行时间 eg.120秒后 -->
<property name="startDelay" value="120000" />
<!-- 触发器运行这个工作的频度(以毫秒作为单位 -->
<property name="repeatInterval" value="300000" />
</bean>
<!-- 定时触发 -->
<bean id="cronCompassTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="compassJob" />
<property name="cronExpression">
<value>0 0 6 * * ?</value>
</property>
</bean>
<bean name="compassJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass">
<value>com.lice.task.CompassTask</value>
</property>
<!-- 给 CompassTask要注入的参数-->
<property name="jobDataAsMap">
<map>
<entry key="compassGps">
<ref bean="compassGps"/>
</entry>
</map>
</property>
</bean>
</beans>
九、配置一个中文分词paoding-dic-home.properties
paoding.dic.home=C:/paoding/dic
paoding.dic.detector.interval=60
十、hibernate.cfg.xml
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<mapping class="com.lice.model.Product"/>
</session-factory>
</hibernate-configuration>
十一、启动加载的一个lintener
package com.lice.listener;
import java.io.File;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.compass.gps.CompassGps;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
public class StartupListener implements ServletContextListener {
private static final Log log = LogFactory.getLog(StartupListener.class);
public static ApplicationContext ctx = null;
public void contextDestroyed(ServletContextEvent arg0) {
// TODO Auto-generated method stub
}
public void contextInitialized(ServletContextEvent event) {
ServletContext context = event.getServletContext();
try{
ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
CompassGps compassGps=(CompassGps) ctx.getBean("compassGps");
if(!compassGps.isRunning()){
compassGps.start();
log.info("删除现有索引");
File f=new File("lucene/indexes");
if(f.exists()){
deleteFiles(f);
}
log.info("原始索引文件删除完毕");
log.info("compass开始构建索引");
new Thread(){
public void run(){
try{
((CompassGps)ctx.getBean("compassGps")).index();
log.info("compass成功构建索引");
}catch(Exception e){
e.printStackTrace();
log.error("compass构建索引失败",e);
}
}
}.start();
}
}catch(Exception e){
log.error("加载compass错误",e);
}
}
private void deleteFiles(File tmpFile){
if(tmpFile.isDirectory()){
for(File file:tmpFile.listFiles()){
deleteFiles(file);
}
}else{
tmpFile.delete();
}
}
}
相关推荐
这篇博客文章“Compass与ssh框架整合”将深入探讨如何将Compass集成到SSH框架中,以实现更高效的数据检索。 首先,我们需要理解SSH框架的核心组件: 1. **Spring**:是一个全面的开源应用框架,提供了依赖注入(DI...
2. 配置Spring XML,定义Compass搜索引擎的bean,并设置Hibernate整合。 3. 在Hibernate配置中启用Hibernate GPS,以跟踪数据库的更改。 4. 在SSH2(Spring Security)配置中定义权限和角色,以确保只有授权用户能...
本资源是struts2 + spring2.5 + hibernate 3.2 + lucene 2.4 + compass 2.0整合实例,可以为初学入门者,提供个参考,本人也是网上找的,感觉很不错(因其中所用的jar文件太大,无法上传,大家可以自己添加各框架...
这个是compass整合ssh的例子,最重要的一点是一对多的关联这方面,寡人整了一天才把compass关联搞定,网上有关compass的资源太少了,不想让以后的人这么为难,咱就上传个我自己的练习吧,有较为详细的注释,希望能对...
SSH2和Compass整合构建搜索引擎是一个在Java Web开发中实现高效全文检索的常见技术实践。SSH2是指Spring、Struts2和Hibernate这三个开源框架的组合,它们分别负责控制层、表现层和持久层的处理。而Compass是一个基于...
SSH+compass整合的小例子,导入即可运行,数据库用的是mysql,用的都是注解技术,代码良好,dao层用了江南白衣的思想,根据泛型和反射封装,可以做基类,里面有注册和查询的小例子,基本可以在此基础上继续开放你所...
**整合 Compass、Hibernate、Struts 2 和 Spring:** 这个集成示例可能包含了一个使用这些框架协同工作的 Web 应用项目。通常,整合步骤会涉及到以下内容: - 将所有必要的 JAR 包添加到项目的类路径中,包括 ...
通过研究这个SSH2+Compass2.2搜索实例,开发者可以学习到如何在J2EE应用中整合多个框架以实现复杂的功能,如搜索引擎集成。此外,还会了解如何使用MyEclipse这样的IDE进行开发,以及如何管理和部署SQL数据库。这是一...
这个实例提供了从零开始使用Compass进行全文检索的一个起点,通过它你可以快速地了解和实践Compass的使用,同时也可以学习如何在SSH框架下整合全文检索功能。在深入学习和实践中,你将进一步掌握如何利用Compass提升...
Spring还能管理事务、整合其他框架,如Hibernate,以及提供服务层和数据访问层的支持。 Hibernate作为持久化层的解决方案,简化了数据库操作,通过对象关系映射(ORM)实现了Java对象与数据库表的对应,支持CRUD...
- Compass Lucene用于整合全文搜索功能。 5. 软件开发和维护效率的提升: - 通过SSH框架的扩展与集成,开发者可以在统一的架构下利用各种技术优势,降低开发复杂性,提高代码的复用度,从而提高软件开发和维护的...
总结来说,这个项目展示了如何通过整合Struts2、Hibernate、Spring和Compass,构建一个具备全文检索功能的Java Web应用。这样的架构不仅实现了业务逻辑和数据访问的解耦,还提高了数据查询的性能,为用户提供了一种...
标题中的“业余框架整合-SSHD-(1)-整体概述”指的是一个关于集成SSH(Spring、Struts、Hibernate)与SSHD(Secure Shell Daemon)框架的教程。SSH是Java Web开发中常用的三大框架,用于构建MVC模式的应用程序,而...
整合这些技术时,开发者通常会创建一个综合的配置文件体系,例如Spring的配置文件可以管理所有组件的依赖和配置,通过引入Struts、Hibernate、JPA、Lucene、JBPM和Compass的相关配置。这需要对每个框架的原理有深入...
同时,了解如何整合SSH(Struts、Spring、Hibernate)。 9. **其他开源框架**:对Mybatis和SpringMVC有一定了解,这两个框架也是常见的Java Web开发工具。 10. **脚本技能**:掌握JavaScript、jQuery和AJAX,以及...
他还熟练掌握Spring框架,包括IOC、DI、AOP以及SSH整合。此外,他了解Mybatis和SpringMVC框架。在数据库技能方面,他熟悉Oracle和MySQL,能进行PL/SQL开发并优化MySQL数据库。 除了这些核心技术,王强还擅长前端...
Spring框架的使用也很熟练,包括IOC/DI、AOP、声明式事务处理以及SSH整合。他还/她熟悉Mybatis和SpringMVC框架。 在数据库技能方面,工程师熟悉Oracle和MySQL,能够进行PL/SQL开发和数据库优化。除此之外,他/她还...