Hi,
This thread was in a different forum, but may help.
http://forums.java.net/jive/message.jsp ... eID=250807
Regards,
Lynette
@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);
}
}
}