<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=stefanrufer" rel="nofollow">Stefan Rufer</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9013?redirect=false" rel="nofollow">SPR-9013</a></strong> and commented</p>
<p dir="auto">AbstractEnvironment calls the overridable method customizePropertySources from the default constructor. This gives subclasses a good chance to run into uninitialized member variables (see attached test case for an example).</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 GA</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/19288/CustomizedEnvironment.java" rel="nofollow">CustomizedEnvironment.java</a> (<em>486 bytes</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/19289/CustomizedEnvironmentTest.java" rel="nofollow">CustomizedEnvironmentTest.java</a> (<em>362 bytes</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398152228" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14288" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14288/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14288">#14288</a> Revisit AbstractEnvironment constructor invocation of protected #customizePropertySources (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/7535e24deb91135b3349220ec566ced203a708c4/hovercard" href="https://github.com/spring-projects/spring-framework/commit/7535e24deb91135b3349220ec566ced203a708c4"><tt>7535e24</tt></a></p>
<p dir="auto">3 votes, 6 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=jbar" rel="nofollow">Joern Barthel</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-1338?redirect=false" rel="nofollow">SPR-1338</a></strong> and commented</p>
<p dir="auto">Hence I configure my <code class="notranslate">@Entity</code> (and such) annotated domain objects as Spring beans I was reluctant to provide a list of them to the AnnotationSessionFactoryBean FactoryBean's setAnnotatedClasses() method. Instead I wrote a rather trivial BeanPostProcessor which provides a list of <code class="notranslate">@Entity</code> beans to the SessionFactory.</p>
<p dir="auto">If there is an interest in putting this into e.g. org.springframework.orm.hibernate3.annotation I'd post the classes here.</p>
<hr>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/13149/AnnotationSessionFactoryBean.java" rel="nofollow">AnnotationSessionFactoryBean.java</a> (<em>1.92 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/11195/entity-discovery.zip" rel="nofollow">entity-discovery.zip</a> (<em>4.07 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398087697" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9415" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9415/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9415">#9415</a> Scan classpath for persistence annotations when creating session factory for hibernate (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto">6 votes, 7 watchers</p>