Greetings!

I have an entity bean called person which has a 1:n relationship to another 
entity bean called job, which contains all jobs that this person has ever had.

now, i'd like to have a function in person, which gives me only one of these 
jobs, namely the one he's currently working for.

i did it already, and it nearly works, it looks like this:

        Job s;
        @Transient
        public Stelle getCurrentJob() {
                if(s==null){
        EntityManager em = (EntityManager) 
Component.getInstance("entityManager");
                        Long sid = (Long) 
em.createQuery("fanceql").setParameter("id", this.id).getSingleResult();
                        s = em.find(Job.class,sid);
                }
                return s;
        }

The problem is, that changes to Job are not saved to the database. why aren't 
they?

is this bad design? how would you do it?

niko

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135642#4135642

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135642
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to