Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8cae4e2
Showing
61 changed files
with
2,089 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
target | ||
.settings | ||
.classpath | ||
.project | ||
.springBeans | ||
*~ | ||
.git | ||
.idea | ||
.DS_Store | ||
tmp |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
MODE=$1 | ||
KEYWORD="REMOVE THIS LINE IF YOU USE $1" | ||
TARGET="projectName-*" | ||
DIRNAME=`echo $MODE | tr "[:upper:]" "[:lower:]"` | ||
|
||
echo "change to $MODE" | ||
|
||
rm -rf tmp | ||
mkdir tmp | ||
cp -r infra/$DIRNAME/* tmp/ | ||
rm -rf `/usr/bin/find tmp -name '.svn' -type d ` | ||
|
||
echo "copy infra/$DIRNAME" | ||
#cp -rf tmp/* src/main/resources | ||
#rm -rf tmp | ||
cp -rf tmp/* ./ | ||
|
||
|
||
sed -i -e "/$KEYWORD/d" `grep -rIl "$1" $TARGET | grep -v '.svn'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
sh change-infra.sh JPA | ||
sed -i -e "s/terasoluna-gfw-multi-web-blank/terasoluna-gfw-multi-web-blank-jpa/g" pom.xml | ||
sed -i -e "s/terasoluna-gfw-multi-web-blank/terasoluna-gfw-multi-web-blank-jpa/g" create-maven-archetype.sh | ||
sed -i -e "s/TERASOLUNA Web Blank Multi Project/TERASOLUNA Web Blank Multi Project (JPA)/g" pom.xml | ||
sh create-maven-archetype.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
sh change-infra.sh MyBatis2 | ||
sed -i -e "s/terasoluna-gfw-multi-web-blank/terasoluna-gfw-multi-web-blank-mybatis2/g" pom.xml | ||
sed -i -e "s/terasoluna-gfw-multi-web-blank/terasoluna-gfw-multi-web-blank-mybatis2/g" create-maven-archetype.sh | ||
sed -i -e "s/TERASOLUNA Web Blank Multi Project/TERASOLUNA Web Blank Multi Project (MyBatis2)/g" pom.xml | ||
sh create-maven-archetype.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
#rm -rf ${HOME}/.m2/repository/xxxxxx | ||
rm -rf ./target | ||
rm -rf ./tmp | ||
mkdir tmp | ||
cp -r pom.xml infra projectName* tmp | ||
pushd tmp | ||
|
||
# rename "projectName" in filename to replace by ${artifactId} | ||
mv projectName-domain/src/main/resources/META-INF/spring/projectName-domain.xml projectName-domain/src/main/resources/META-INF/spring/__rootArtifactId__-domain.xml | ||
mv projectName-domain/src/main/resources/META-INF/spring/projectName-infra.xml projectName-domain/src/main/resources/META-INF/spring/__rootArtifactId__-infra.xml | ||
mv projectName-domain/src/main/resources/META-INF/spring/projectName-codelist.xml projectName-domain/src/main/resources/META-INF/spring/__rootArtifactId__-codelist.xml | ||
mv projectName-env/src/main/resources/META-INF/spring/projectName-env.xml projectName-env/src/main/resources/META-INF/spring/__rootArtifactId__-env.xml | ||
mv projectName-env/src/main/resources/META-INF/spring/projectName-infra.properties projectName-env/src/main/resources/META-INF/spring/__rootArtifactId__-infra.properties | ||
rm -rf infra | ||
rm -rf `/usr/bin/find . -name '.svn' -type d` | ||
mvn archetype:create-from-project | ||
|
||
pushd target/generated-sources/archetype | ||
sed -i -e "s/xxxxxx\.yyyyyy\.zzzzzz/org.terasoluna.gfw.blank/g" pom.xml | ||
sed -i -e "s/projectName/terasoluna-gfw-multi-web-blank/g" pom.xml | ||
mvn deploy |
40 changes: 40 additions & 0 deletions
40
infra/jpa/projectName-domain/src/main/resources/META-INF/spring/projectName-infra.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?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:jpa="http://www.springframework.org/schema/data/jpa" | ||
xmlns:util="http://www.springframework.org/schema/util" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | ||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd | ||
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd"> | ||
|
||
<import resource="classpath:/META-INF/spring/projectName-env.xml" /> | ||
|
||
<jpa:repositories base-package="xxxxxx.yyyyyy.zzzzzz.domain.repository"></jpa:repositories> | ||
|
||
<bean id="jpaVendorAdapter" | ||
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> | ||
<property name="showSql" value="false" /> | ||
<property name="database" value="${database}" /> | ||
</bean> | ||
|
||
<bean | ||
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" | ||
id="entityManagerFactory"> | ||
<property name="packagesToScan" value="xxxxxx.yyyyyy.zzzzzz.domain.model" /> | ||
<property name="dataSource" ref="dataSource" /> | ||
<property name="jpaVendorAdapter" ref="jpaVendorAdapter" /> | ||
<property name="jpaPropertyMap"> | ||
<util:map> | ||
<entry key="hibernate.hbm2ddl.auto" value="none" /> | ||
<entry key="hibernate.ejb.naming_strategy" | ||
value="org.hibernate.cfg.ImprovedNamingStrategy" /> | ||
<entry key="hibernate.connection.charSet" value="UTF-8" /> | ||
<entry key="hibernate.show_sql" value="false" /> | ||
<entry key="hibernate.format_sql" value="false" /> | ||
<entry key="hibernate.use_sql_comments" value="true" /> | ||
<entry key="hibernate.jdbc.batch_size" value="30" /> | ||
<entry key="hibernate.jdbc.fetch_size" value="100" /> | ||
</util:map> | ||
</property> | ||
</bean> | ||
|
||
</beans> |
7 changes: 7 additions & 0 deletions
7
...a/mybatis2/projectName-domain/src/main/resources/META-INF/mybatis/config/sqlMapConfig.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!DOCTYPE sqlMapConfig | ||
PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" | ||
"http://ibatis.apache.org/dtd/sql-map-config-2.dtd"> | ||
<sqlMapConfig> | ||
<settings useStatementNamespaces="true" /> | ||
</sqlMapConfig> |
72 changes: 72 additions & 0 deletions
72
infra/mybatis2/projectName-domain/src/main/resources/META-INF/mybatis/sql/sample-sqlmap.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!DOCTYPE sqlMap | ||
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" | ||
"http://ibatis.apache.org/dtd/sql-map-2.dtd"> | ||
|
||
<sqlMap namespace="todo"> | ||
<!-- | ||
<resultMap id="todo" class="todo.domain.model.Todo"> | ||
<result property="todoId" column="todo_id" /> | ||
<result property="todoTitle" column="todo_title" /> | ||
<result property="finished" column="finished" /> | ||
<result property="createdAt" column="created_at" /> | ||
</resultMap> | ||
<select id="findOne" parameterClass="java.lang.String" | ||
resultMap="todo"><![CDATA[ | ||
SELECT todo_id, | ||
todo_title, | ||
finished, | ||
created_at | ||
FROM todo | ||
WHERE todo_id = #value# | ||
]]></select> | ||
<select id="findAll" resultMap="todo"><![CDATA[ | ||
SELECT todo_id, | ||
todo_title, | ||
finished, | ||
created_at | ||
FROM todo | ||
]]></select> | ||
<insert id="create" parameterClass="todo.domain.model.Todo"><![CDATA[ | ||
INSERT INTO todo | ||
(todo_id, | ||
todo_title, | ||
finished, | ||
created_at) | ||
VALUES ( #todoId#, | ||
#todoTitle#, | ||
#finished#, | ||
#createdAt# ) | ||
]]></insert> | ||
<update id="update" parameterClass="todo.domain.model.Todo"><![CDATA[ | ||
UPDATE todo | ||
SET todo_title = #todoTitle#, | ||
finished = #finished#, | ||
created_at = #createdAt# | ||
WHERE todo_id = #todoId# | ||
]]></update> | ||
<delete id="delete" parameterClass="todo.domain.model.Todo"><![CDATA[ | ||
DELETE FROM todo | ||
WHERE todo_id = #todoId# | ||
]]></delete> | ||
<select id="countByFinished" parameterClass="java.lang.Boolean" | ||
resultClass="java.lang.Long"><![CDATA[ | ||
SELECT COUNT(*) | ||
FROM todo | ||
WHERE finished = #value# | ||
]]></select> | ||
<select id="exists" parameterClass="java.lang.String" | ||
resultClass="java.lang.Long"><![CDATA[ | ||
SELECT COUNT(*) | ||
FROM todo | ||
WHERE todo_id = #value# | ||
]]></select> | ||
--> | ||
</sqlMap> |
34 changes: 34 additions & 0 deletions
34
infra/mybatis2/projectName-domain/src/main/resources/META-INF/spring/projectName-infra.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?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.xsd"> | ||
|
||
<import resource="classpath:/META-INF/spring/projectName-env.xml" /> | ||
|
||
<bean id="sqlMapClient" | ||
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> | ||
<property name="configLocations" | ||
value="classpath*:/META-INF/mybatis/config/*sqlMapConfig.xml" /> | ||
<property name="mappingLocations" | ||
value="classpath*:/META-INF/mybatis/sql/**/*-sqlmap.xml" /> | ||
<property name="dataSource" ref="dataSource" /> | ||
</bean> | ||
|
||
<bean id="queryDAO" class="jp.terasoluna.fw.dao.ibatis.QueryDAOiBatisImpl"> | ||
<property name="sqlMapClient" ref="sqlMapClient" /> | ||
</bean> | ||
|
||
<bean id="updateDAO" class="jp.terasoluna.fw.dao.ibatis.UpdateDAOiBatisImpl"> | ||
<property name="sqlMapClient" ref="sqlMapClient" /> | ||
</bean> | ||
|
||
<bean id="spDAO" | ||
class="jp.terasoluna.fw.dao.ibatis.StoredProcedureDAOiBatisImpl"> | ||
<property name="sqlMapClient" ref="sqlMapClient" /> | ||
</bean> | ||
|
||
<bean id="queryRowHandleDAO" | ||
class="jp.terasoluna.fw.dao.ibatis.QueryRowHandleDAOiBatisImpl"> | ||
<property name="sqlMapClient" ref="sqlMapClient" /> | ||
</bean> | ||
</beans> |
Oops, something went wrong.