Add spring-batch- to module directory names (so folks can use mvn eclipse:eclipse if they want to).

BATCH-238: Remove hibernate support for the Daos.
This commit is contained in:
dsyer
2007-12-10 21:23:48 +00:00
parent 17705f27ab
commit 8ea331bfc7
884 changed files with 956 additions and 2352 deletions

View File

@@ -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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="dataSource" class="test.jdbc.datasource.InitializingDataSourceFactoryBean">
<property name="dataSource" ref="hsql" />
<property name="initScript" value="org/springframework/batch/jms/init.sql" />
<property name="destroyScript" value="org/springframework/batch/jms/destroy.sql" />
</bean>
<bean id="hsql" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="true"
autowire-candidate="false">
<property name="driverClassName" value="org.hsqldb.jdbcDriver" />
<property name="url" value="jdbc:hsqldb:mem:testdb" />
</bean>
<bean id="derby" class="test.jdbc.datasource.DerbyDataSourceFactoryBean" lazy-init="true" destroy-method="destroy"
autowire-candidate="false">
<property name="dataDirectory" value="derby-home" />
</bean>
<bean id="brokerService" class="org.apache.activemq.broker.BrokerService" init-method="start"
destroy-method="stop">
<property name="brokerName" value="broker" />
<property name="useJmx" value="false"/>
<property name="transportConnectorURIs">
<list>
<value>vm://localhost</value>
</list>
</property>
<property name="persistenceAdapter">
<bean class="org.apache.activemq.store.memory.MemoryPersistenceAdapter"/>
<!-- bean class="org.apache.activemq.store.jdbc.JDBCPersistenceAdapter">
<property name="dataSource" ref="dataSource"/>
<property name="createTablesOnStartup" value="true" />
</bean-->
</property>
</bean>
</beans>

View File

@@ -0,0 +1,8 @@
log4j.rootCategory=INFO, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
log4j.category.org.apache.activemq=ERROR
# log4j.category.org.springframework=DEBUG

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<trade>
<isin>isin1</isin>
<quantity>1</quantity>
<price>1</price>
<customer>customer1</customer>
</trade>
<trade>
<isin>isin2</isin>
<quantity>2</quantity>
<price>2</price>
<customer>customer2</customer>
</trade>
<trade>
<isin>isin3</isin>
<quantity>3</quantity>
<price>3</price>
<customer>customer3</customer>
</trade>
</root>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<records>
<trade>
<isin>XYZ0001</isin>
<quantity>5</quantity>
<price>11.39</price>
<customer>Customer1</customer>
</trade>
<trade>
<isin>XYZ0002</isin>
<quantity>2</quantity>
<price>72.99</price>
<customer>Customer2</customer>
</trade>
<trade>
<isin>XYZ0003</isin>
<quantity>9</quantity>
<price>99.99</price>
<customer>Customer3</customer>
</trade>
</records>

View File

@@ -0,0 +1,23 @@
<mapping>
<class name="org.springframework.batch.io.oxm.domain.Trade">
<map-to xml="trade" />
<field name="isin">
<bind-xml name="isin" node="element" />
</field>
<field name="quantity">
<bind-xml name="quantity" node="element" />
</field>
<field name="price">
<bind-xml name="price" node="element" />
</field>
<field name="customer">
<bind-xml name="customer" node="element" />
</field>
</class>
</mapping>

View File

@@ -0,0 +1 @@
DROP TABLE T_FOOS;

View File

@@ -0,0 +1,5 @@
create table T_FOOS (
id integer not null primary key,
name varchar(80),
foo_date timestamp
);

View File

@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
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.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<import resource="classpath:/data-source.xml"/>
<!-- Transaction manager for a datasource -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- Transaction manager for jms -->
<bean id="jmsTransactionManager" autowire-candidate="false"
class="org.springframework.jms.connection.JmsTransactionManager">
<property name="connectionFactory" ref="connectionFactory" />
</bean>
<bean id="jmsTemplate"
class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<property name="receiveTimeout" value="100" />
<!-- This is important... -->
<property name="sessionTransacted" value="true" />
</bean>
<bean id="jdbcTemplate"
class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="brokerService">
<property name="brokerURL">
<value>vm://localhost</value>
</property>
</bean>
<bean id="txAwareConnectionFactory"
class="org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy">
<property name="targetConnectionFactory" ref="connectionFactory"/>
<property name="synchedLocalTransactionAllowed" value="true" />
</bean>
<bean id="container"
class="org.springframework.batch.container.jms.BatchMessageListenerContainer">
<property name="transactionManager" ref="transactionManager" />
<property name="connectionFactory"
ref="txAwareConnectionFactory" />
<property name="destinationName" value="queue" />
<!-- This is important... it forces the container to acknowledge message receipt,
and avoid duplicate messages in the sunny day case -->
<property name="sessionTransacted" value="true" />
<constructor-arg ref="transactionalBatchTemplate" />
</bean>
<bean id="batchTemplate"
class="org.springframework.batch.repeat.support.RepeatTemplate">
<property name="completionPolicy">
<bean
class="org.springframework.batch.repeat.policy.SimpleCompletionPolicy">
<constructor-arg value="2" />
</bean>
</property>
</bean>
<bean id="transactionalBatchTemplate"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager" />
<property name="proxyInterfaces">
<value>
org.springframework.batch.repeat.RepeatOperations
</value>
</property>
<property name="proxyTargetClass" value="false" />
<property name="transactionAttributes"
value="*=PROPAGATION_REQUIRED">
</property>
<property name="target">
<bean
class="org.springframework.batch.repeat.support.RepeatTemplate">
<property name="completionPolicy">
<bean
class="org.springframework.batch.repeat.policy.SimpleCompletionPolicy">
<constructor-arg value="2" />
</bean>
</property>
</bean>
</property>
</bean>
</beans>