转 appfuse

[url]http://blog.csdn.net/java20100406/article/details/6049041[/url]
[url]http://blog.csdn.net/bluishglc/article/details/6730773[/url]
[url]http://www.cnblogs.com/QQParadise/articles/1441416.html[/url]
插件 svn checkout https://github.com/appfuse/appfuse/trunk/plugins/appfuse-maven-plugin appfuse-maven-plugin

compass [url]http://blog.sina.com.cn/s/blog_90c4a900010123gf.html[/url]

新建模板工程
mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts-archetype -DarchetypeVersion=2.1.0 -DarchetypeRepository=http://oss.sonatype.org/content/repositories/appfuse -DgroupId=com.asxm -DartifactId=appfuse

获取appfuse代码
mvn appfuse:full-source

获取appfuse代码生成模板
mvn appfuse:copy-templates

update pom.xml jdbc setting

applicationContext

change to

create entity class add @Entity @Id annotation

代码生成/删除
mvn appfuse:gen -Dentity=Name
mvn appfuse:remove -Dentity=Name

pom.xml中查找genericCore,大概在940行 找到 将属性true 改为false

根据数据库反向生成实体类
mvn appfuse:gen-model

hibernate.reveng 文件用于控制反向工程
其中可以配置表过滤,这样在生成pojo时就不会生成被过滤的表对应的类。

hibernate.reveng 的路径是src/test/resources。



可改为

运行项目
mvn jetty:run

eclipse 里运行时可能不会正确生成数据库,需要用命令方式

pom.xml配置中增加true跳过集成测试及相关数据库初始化操作

hibernate3-maven-plugin 数据库操作
dbunit-maven-plugin 数据操作

使用 mvn dbunit:export -Ddest=sample-data.xml 将数据库的数据导出来

发生native2ascii 相关错误 拷贝tools.jar 到jre/lib/ext 目录

displaytag 标签的国际化资源文件需要在pom中配置
另外需增加en结尾的文件 否则英文无法显示。

appfuse内属性文件编码部分为utf8 在pom中配置编码替换 而非用eclipse的属性文件编辑器及时变换。


连接池变更















org.hibernate
hibernate-c3p0
3.3.2.GA




当前action
ActionContext.getContext().getName();

类型转换器定义
xwork-conversion.properties

修改时间格式 属性文件内
date.format=yyyy-MM-dd

appfuse 默认用protetypeJS库
如果该用jquery 需注意 $() 调用的返回值不同


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部