Can you please advice me, how can I nicely enable Spring autowiring for Hibernate entities?
Let's say I have an entity and would like to have mail-sender there:
@Entity
public class EmailActivity extends Activity {
@Autowired @Transient
private JavaMailSender javaMailSender;
...
}
Is there any better way than doing
AutowireCapableBeanFactory.autowireBean(
getCurrentSession().get(Activity.class, id)
);
in my DAO?
thanks!