KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > domain > hibernate > AppliedPatchImpl


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.domain.hibernate;
18
19 import java.util.Date JavaDoc;
20
21 import org.alfresco.repo.domain.AppliedPatch;
22
23 /**
24  * Hibernate-specific implementation of the persistent object.
25  *
26  * @author Derek Hulley
27  */

28 public class AppliedPatchImpl implements AppliedPatch
29 {
30     private String JavaDoc id;
31     private String JavaDoc description;
32     private int fixesFromSchema;
33     private int fixesToSchema;
34     private int targetSchema;
35
36     private int appliedToSchema;
37     private String JavaDoc appliedToServer;
38     private Date JavaDoc appliedOnDate;
39     private boolean wasExecuted;
40     private boolean succeeded;
41     private String JavaDoc report;
42     
43     public AppliedPatchImpl()
44     {
45     }
46     
47     @Override JavaDoc
48     public String JavaDoc toString()
49     {
50         StringBuilder JavaDoc sb = new StringBuilder JavaDoc(256);
51         sb.append("AppliedPatch")
52           .append("[ id=").append(id)
53           .append(", description=").append(description)
54           .append(", fixesFromSchema=").append(fixesFromSchema)
55           .append(", fixesToSchema=").append(fixesToSchema)
56           .append(", targetSchema=").append(targetSchema)
57           .append(", appliedToSchema=").append(appliedToSchema)
58           .append(", appliedToServer=").append(appliedToServer)
59           .append(", appliedOnDate=").append(appliedOnDate)
60           .append(", wasExecuted=").append(wasExecuted)
61           .append(", succeeded=").append(succeeded)
62           .append(", report=").append(report)
63           .append("]");
64         return sb.toString();
65     }
66
67     public String JavaDoc getId()
68     {
69         return id;
70     }
71     public void setId(String JavaDoc id)
72     {
73         this.id = id;
74     }
75     
76     public String JavaDoc getDescription()
77     {
78         return description;
79     }
80     public void setDescription(String JavaDoc description)
81     {
82         if (description != null && description.length() > 1024)
83         {
84             // truncate as necessary
85
description = (description.substring(0, 1020) + "...");
86         }
87         this.description = description;
88     }
89
90     public int getFixesFromSchema()
91     {
92         return fixesFromSchema;
93     }
94     public void setFixesFromSchema(int version)
95     {
96         this.fixesFromSchema = version;
97     }
98
99     public int getFixesToSchema()
100     {
101         return fixesToSchema;
102     }
103     public void setFixesToSchema(int version)
104     {
105         this.fixesToSchema = version;
106     }
107
108     public int getTargetSchema()
109     {
110         return targetSchema;
111     }
112     public void setTargetSchema(int currentSchema)
113     {
114         this.targetSchema = currentSchema;
115     }
116
117     public int getAppliedToSchema()
118     {
119         return appliedToSchema;
120     }
121     public void setAppliedToSchema(int version)
122     {
123         this.appliedToSchema = version;
124     }
125
126     public String JavaDoc getAppliedToServer()
127     {
128         return appliedToServer;
129     }
130
131     public void setAppliedToServer(String JavaDoc appliedToServer)
132     {
133         this.appliedToServer = appliedToServer;
134     }
135
136     public Date JavaDoc getAppliedOnDate()
137     {
138         return appliedOnDate;
139     }
140     public void setAppliedOnDate(Date JavaDoc appliedOnDate)
141     {
142         this.appliedOnDate = appliedOnDate;
143     }
144     
145     public boolean getWasExecuted()
146     {
147         return wasExecuted;
148     }
149     public void setWasExecuted(boolean wasExecuted)
150     {
151         this.wasExecuted = wasExecuted;
152     }
153     
154     public boolean getSucceeded()
155     {
156         return succeeded;
157     }
158     public void setSucceeded(boolean succeeded)
159     {
160         this.succeeded = succeeded;
161     }
162
163     public String JavaDoc getReport()
164     {
165         return report;
166     }
167     public void setReport(String JavaDoc report)
168     {
169         if (report != null && report.length() > 1024)
170         {
171             // truncate as necessary
172
report = (report.substring(0, 1020) + "...");
173         }
174         this.report = report;
175     }
176 }
Popular Tags