Hi.
This is what i did, and it works as expected:
@Stateless(name="ImagesServiceImpl")
public class ImagesServiceImpl implements ImagesService {
@PersistenceContext
EntityManager em;
public Long getNewImageId() {
Query q = em.createNativeQuery(
"SELECT nextval('global_next_image_id_seq') AS ID");
try {
return (Long)((List) q.getSingleResult()).get(0);
}
catch(Exception ex) {
throw new RuntimeException(ex.getMessage(), ex);
}
}
}
[Message sent by forum member 'frank_martinez' (frank_martinez)]
http://forums.java.net/jive/thread.jspa?messageID=295165