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.CascadeType;
 import  javax.persistence.Entity;
 import  javax.persistence.GeneratedValue;
 import  javax.persistence.GenerationType;
 import  javax.persistence.Id;
 import  javax.persistence.JoinColumn;
 import  javax.persistence.OneToMany;
 import  javax.persistence.SequenceGenerator;
 import  javax.persistence.Table;
 
 import  org.kie.internal.task.api.model.BooleanExpression;
 import  org.kie.internal.task.api.model.Notification;
 import  org.kie.internal.task.api.model.Reassignment;
 
 @Entity
 @Table(name="Escalation")
 @SequenceGenerator(name="escalationIdSeq", sequenceName="ESCALATION_ID_SEQ", allocationSize=1)
 public class EscalationImpl implements org.kie.internal.task.api.model.Escalation {
 
     @Id
     @GeneratedValue(strategy = GenerationType.AUTO, generator="escalationIdSeq")
     private Long                    id;
 
     private String                  name;
 
     @OneToMany(cascade = CascadeType.ALL, targetEntity=BooleanExpressionImpl.class)
     @JoinColumn(name = "Escalation_Constraints_Id", nullable = true)
     private List<BooleanExpression> constraints   = Collections.emptyList();
 
     @OneToMany(cascade = CascadeType.ALL, targetEntity=NotificationImpl.class)
     @JoinColumn(name = "Escalation_Notifications_Id", nullable = true)
     private List<Notification>      notifications = Collections.emptyList();
 
     @OneToMany(cascade = CascadeType.ALL, targetEntity=ReassignmentImpl.class)
     @JoinColumn(name = "Escalation_Reassignments_Id", nullable = true)
     private List<Reassignment>      reassignments = Collections.emptyList();
     
     public void writeExternal(ObjectOutput outthrows IOException {
         out.writeLong(   );
         
         if (  != null ) {
             out.writeBooleantrue );
             out.writeUTF );
         } else {
             out.writeBooleanfalse );
         }
         CollectionUtils.writeBooleanExpressionListout );
         CollectionUtils.writeNotificationListout );
         CollectionUtils.writeReassignmentListout );        
     }
     
     public void readExternal(ObjectInput inthrows IOException,
                                             ClassNotFoundException {
         = in.readLong();
        if ( in.readBoolean() ) {
             = in.readUTF();
        }
         = CollectionUtils.readBooleanExpressionListin );
         = CollectionUtils.readNotificationListin );
         = CollectionUtils.readReassignmentListin );
         
     }
 
     public long getId() {
         return ;
     }
 
     public void setId(long id) {
         this. = id;
     }
 
     public String getName() {
         return ;
     }
    public void setName(String name) {
        this. = name;
    }
    public List<BooleanExpression> getConstraints() {
        return ;
    }
    public void setConstraints(List<BooleanExpression> constraints) {
        this. = constraints;
    }
    public List<Notification> getNotifications() {
        return ;
    }
    public void setNotifications(List<Notification> notifications) {
        this. = notifications;
    }
    public List<Reassignment> getReassignments() {
        return ;
    }
    public void setReassignments(List<Reassignment> reassignments) {
        this. = reassignments;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + CollectionUtils.hashCode );
        result = prime * result + (( == null) ? 0 : .hashCode());
        result = prime * result + CollectionUtils.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 EscalationImpl) ) return false;
        EscalationImpl other = (EscalationImplobj;
        if (  == null ) {
            if ( other.name != null ) return false;
        } else if ( !.equalsother.name ) ) return false;
        return CollectionUtils.equals,
                                       other.constraints ) && CollectionUtils.equals,
                                                                                      other.notifications ) && CollectionUtils.equals,
                                                                                                                                       other.reassignments );
    }
New to GrepCode? Check out our FAQ X