Java Reference
In-Depth Information
Let's look at the details of each bean definition:
B
This bean definition creates a
PlaceOrderFacade
and injects the
PlaceOrderService,
and
PlaceOrderFacadeResultFactory
. The
RestaurantRepository
and
PlaceOrder-
FacadeResultFactory
beans are defined later in this section because there are sep-
arate Hibernate and
JDO
versions.
c
D
This bean definition creates a
PlaceOrderService
and injects the repositories.
This bean definition creates a
TransactionInterceptor
and injects the
Platform-
TransactionManager
, which is defined later in this section.
This bean definition defines the
BeanNameAutoProxyCreator
, which applies the
TransactionInterceptor
to all calls to
PlaceOrderFacade
.
All of these beans (except the
BeanNameAutoProxyCreator
) depend on persistence
framework-specific classes. For example, the
PlaceOrderService
must be injected
with the persistence framework-specific implementations of the repositories. Let's
look at the definition of the
JDO
-specific Spring beans.
E
7.6.2
JDO-specific bean definitions
The JDO bean definitions instantiate the
JDO
implementations of the repositories
and result factory, the
JdoTransactionManager
, the
JdoTemplate
, and the
Persis-
tenceManagerFactory
. Listing 7.5 shows these bean definitions.
Listing 7.5
placeOrderFacade-jdo-beans.xml
<beans>
B
<bean id="myTransactionManager"
class="org.springframework.orm.jdo.JdoTransactionManager">
<property name="persistenceManagerFactory"
ref="myPersistenceManagerFactory" />
</bean>
C
<bean id="PendingOrderRepositoryImpl"
class="net.chrisrichardson.foodToGo.domain.jdo.
bbbbbbbbb
bb
➥
JDOPendingOrderRepositoryImpl">
<constructor-arg ref="JdoTemplate" />
</bean>
<bean id="RestaurantRepositoryImpl"
class="net.chrisrichardson.foodToGo.domain.jdo.
bbbbbb
bb
D
➥
JDORestaurantRepositoryImpl">
<constructor-arg ref="JdoTemplate" />
</bean>
Search WWH ::
Custom Search