hucmuc
Oct 21st, 2004, 01:15 PM
I have following when defining a constructor of a bean:
<constructor-arg>
<bean id="sf1" parent="default.sessionFactory">
<property name="dataSource">
<bean class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/ds</value>
</property>
</bean>
</property>
</bean>
</constructor-arg>
Why am I forced to name my bean (i'm calling it sf1).
However, if I don't use the parent and define the whole bean then I don't need to specify the id (ids for inner beans are meaningless).
I would like to treat these "inner beans" like annoymous classes where I don't need to specify ids since it should only exist in the inner portion of definition (i.e sf1 should never be accessible anywhere else).
dino
<constructor-arg>
<bean id="sf1" parent="default.sessionFactory">
<property name="dataSource">
<bean class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/ds</value>
</property>
</bean>
</property>
</bean>
</constructor-arg>
Why am I forced to name my bean (i'm calling it sf1).
However, if I don't use the parent and define the whole bean then I don't need to specify the id (ids for inner beans are meaningless).
I would like to treat these "inner beans" like annoymous classes where I don't need to specify ids since it should only exist in the inner portion of definition (i.e sf1 should never be accessible anywhere else).
dino