Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2010 JBoss Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 
 package org.jbpm.services.task.impl.model;
 
 import java.util.List;
 
 import  javax.persistence.Embeddable;
 import  javax.persistence.EnumType;
 import  javax.persistence.Enumerated;
 import  javax.persistence.JoinColumn;
 import  javax.persistence.JoinTable;
 import  javax.persistence.ManyToMany;
 
 import  org.kie.api.task.model.OrganizationalEntity;
 import  org.kie.internal.task.api.model.AllowedToDelegate;
 
 @Embeddable
 public class DelegationImpl  implements org.kie.internal.task.api.model.Delegation {
     @Enumerated(EnumType.STRING)      
     private AllowedToDelegate                    allowedToDelegate;
     
     @ManyToMany(targetEntity=OrganizationalEntityImpl.class)
     @JoinTable(name = "Delegation_delegates", joinColumns = @JoinColumn(name = "task_id"), inverseJoinColumns = @JoinColumn(name = "entity_id"))    
     private List<OrganizationalEntity> delegates = Collections.emptyList();
     
     public void writeExternal(ObjectOutput outthrows IOException {
         if (  != null ) {
             out.writeBooleantrue );
             out.writeUTF.toString() );
         } else {
             out.writeBooleanfalse );
         }
         CollectionUtils.writeOrganizationalEntityListout );       
     } 
     
     public void readExternal(ObjectInput inthrows IOException,
                                             ClassNotFoundException {
         if ( in.readBoolean() ) {
              = AllowedToDelegate.valueOf( in.readUTF() );
         }
          = CollectionUtils.readOrganizationalEntityListin );
     }       
 
     public AllowedToDelegate getAllowed() {
         return ;
     }    
     
     public void setAllowed(AllowedToDelegate allowedToDelegate) {
         this. = allowedToDelegate;
     }
 
     public List<OrganizationalEntity> getDelegates() {
         return ;
     }
     
 
     public void setDelegates(List<OrganizationalEntity> delegates) {
         this. = delegates;
     }    
     
     
 
     @Override
     public int hashCode() {
         final int prime = 31;
         int result = 1;
         result = prime * result + (( == null) ? 0 : .hashCode());
         result = prime * result + CollectionUtils.hashCode );
         return result;
     }
 
     @Override
     public boolean equals(Object obj) {
         if ( this == obj ) return true;
         if ( obj == null ) return false;
         if ( !(obj instanceof DelegationImpl) ) return false;
         DelegationImpl other = (DelegationImplobj;
         if (  == null ) {
             if ( other.allowedToDelegate != null ) return false;
         } else if ( !.equals( other.allowedToDelegate ) ) return false;
        
        return CollectionUtils.equalsother.delegates );
    }
New to GrepCode? Check out our FAQ X