Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring SessionFactory creation domain objects auto scanning
    primarykey
    data
    text
    <p>In my spring dao configuration xml I currently have to manually list out the domain classes names. Is there any way to automate this to eliminate the need to manually list out a domain class whenever a new one is created?</p> <p>To give a better idea of what I want to do this, using something similar to component-scan or such</p> <p>Current code</p> <pre><code>&lt;bean id="daoSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt; &lt;property name="dataSource" ref="applicationDataSource" /&gt; &lt;property name="annotatedClasses"&gt; &lt;list&gt; &lt;value&gt;com.greenwhich.application.domain.Driver&lt;/value&gt; &lt;value&gt;com.greenwhich.application.domain.DriverRealTimeCurrentLocation&lt;/value&gt; &lt;value&gt;com.greenwhich.application.domain.Journey&lt;/value&gt; &lt;value&gt;com.greenwhich.application.domain.Customer&lt;/value&gt; &lt;value&gt;com.greenwhich.application.domain.SystemConstants&lt;/value&gt; &lt;value&gt;com.greenwhich.application.domain.DriverRequest&lt;/value&gt; &lt;value&gt;com.greenwhich.application.domain.Account&lt;/value&gt; &lt;/list&gt; &lt;/property&gt; &lt;property name="hibernateProperties"&gt; &lt;props&gt; &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/prop&gt; &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt; &lt;/props&gt; &lt;/property&gt; &lt;/bean&gt; </code></pre> <p>All I require that the values under the "annotatedClasses" property is automatically detected</p> <p>Is there any way to implement this? So far I have tried inserting a component-scan inside of the "annotatedClasses" property searching for the "Entity" annotation which did not work</p> <p>Any help is greatly appreciated</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload