How to auto generate JAXWS annotated class from session bean [message #654079] |
Mon, 14 February 2011 02:19 |
Sam  Messages: 5 Registered: February 2011 |
Junior Member |
|
|
Hello,
Let me rephrase my question in regarding to my previous post.
I want to automatically generate JAX-WS annotated class from an existing session bean. But I couldn't find a way to do that rather than manually adding jaxws annotation to every session beans that I want to expote them as web servcies.
The session bean class is given below:
package au.com.housewareonline.dao;
// Generated 13/02/2011 10:57:42 PM by Hibernate Tools 3.4.0.CR1
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Home object for domain model class Role.
* @see au.com.housewareonline.dao.Role
* @author Hibernate Tools
*/
@Stateless
public class RoleHome {
private static final Log log = LogFactory.getLog(RoleHome.class);
@PersistenceContext
private EntityManager entityManager;
public void persist(Role transientInstance) {
log.debug("persisting Role instance");
try {
entityManager.persist(transientInstance);
log.debug("persist successful");
} catch (RuntimeException re) {
log.error("persist failed", re);
throw re;
}
}
public void remove(Role persistentInstance) {
log.debug("removing Role instance");
try {
entityManager.remove(persistentInstance);
log.debug("remove successful");
} catch (RuntimeException re) {
log.error("remove failed", re);
throw re;
}
}
public Role merge(Role detachedInstance) {
log.debug("merging Role instance");
try {
Role result = entityManager.merge(detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
public Role findById(long id) {
log.debug("getting Role instance with id: " + id);
try {
Role instance = entityManager.find(Role.class, id);
log.debug("get successful");
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
}
Very appreciate for any suggestion and help.
Thanks
Sam
|
|
|
Powered by
FUDForum. Page generated in 0.02006 seconds