0 Replies Latest reply on Apr 15, 2008 3:02 AM by Vemula sriramsudheer

    EntityHome and Deletion operation

    Vemula sriramsudheer Newbie

      Hi All, I was trying to delete an Entity and its Many to Many RelationShip The Following is the code:

      public class UserHome extends EntityHome<User> {
           @Logger Log log;
           @In EntityManager entityManager;
           @In(required = false) 
           UserProfileList userProfileList;
           Role selectedRole;
           public void setUserUserId(Integer id) {
           public Integer getUserUserId() {
                return (Integer) getId();
           protected User createInstance() {
                User user = new User();
                return user;
           public void wire() {
           public boolean isWired() {
                return true;
           public User getDefinedInstance() {
                return isIdDefined() ? getInstance() : null;
           public String validateEntityNotFound() {
                try {
                }catch(EntityNotFoundException enfe) {
                     return "valid";
                return this.isManaged()? "invalid" : "valid";
           public String persist() {
                log.info("------Persist User---------");
                return super.persist();
           public String remove() {
                log.info("---------remove User---------");
                return super.remove();
           public String update() {
                // TODO Auto-generated method stub
                log.info("--------update User--------");
                return super.update();
           public Role getSelectedRole() {
                return selectedRole;
           public void setSelectedRole(Role selectedRole) {
                this.selectedRole = selectedRole;

      When i am adding a User I can see a row in Userroleassn Table but I am Trying to Delete. Its deleting all the Roles and Users associated to that Roles. Could any one please help me in this regard.

      Thanks in advance