G
grz01
Out of curiousity...
when you use the EntityManager in EJB3 to update existing db-records,
like for example:
...
EntityManager em = (EntityManager) ctx.lookup("java:comp/
env/...");
String sQL = "select c from Customer c where c.id=?1";
customer = (Customer)
entityManager.createQuery(sQL).setParameter(1, nId).getSingleResult();
customer.emailaddress = "...";
the last statement will somehow cause an SQL UPDATE-stmt to be sent to
the database.
When the Customer class is just an ordinary POJO (with some
annotations on it)
how does the EntityManager detect or get notified abt such
assignments?
What mechanism in Java is used to achieve this?
when you use the EntityManager in EJB3 to update existing db-records,
like for example:
...
EntityManager em = (EntityManager) ctx.lookup("java:comp/
env/...");
String sQL = "select c from Customer c where c.id=?1";
customer = (Customer)
entityManager.createQuery(sQL).setParameter(1, nId).getSingleResult();
customer.emailaddress = "...";
the last statement will somehow cause an SQL UPDATE-stmt to be sent to
the database.
When the Customer class is just an ordinary POJO (with some
annotations on it)
how does the EntityManager detect or get notified abt such
assignments?
What mechanism in Java is used to achieve this?