Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ResponsibilityTemplateBo |
|
| 0.0;0 |
1 | /* | |
2 | * Copyright 2007-2008 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing responsibilitys and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.kim.impl.responsibility; | |
17 | ||
18 | ||
19 | import javax.persistence.Column | |
20 | import javax.persistence.Entity | |
21 | import javax.persistence.Id | |
22 | import javax.persistence.Table | |
23 | import org.kuali.rice.kim.api.common.template.Template | |
24 | import org.kuali.rice.kim.api.common.template.TemplateContract | |
25 | import org.kuali.rice.kim.impl.common.template.TemplateBo | |
26 | ||
27 | /** | |
28 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
29 | */ | |
30 | @Entity | |
31 | @Table(name = "KRIM_RSP_TMPL_T") | |
32 | public class ResponsibilityTemplateBo extends TemplateBo implements TemplateContract { | |
33 | private static final long serialVersionUID = 1L; | |
34 | ||
35 | @Id | |
36 | @Column(name = "RSP_TMPL_ID") | |
37 | String id | |
38 | ||
39 | /** | |
40 | * Converts a mutable bo to its immutable counterpart | |
41 | * @param bo the mutable business object | |
42 | * @return the immutable object | |
43 | */ | |
44 | static Template to(ResponsibilityTemplateBo bo) { | |
45 | 0 | if (bo == null) { |
46 | 0 | return null |
47 | } | |
48 | ||
49 | 0 | return Template.Builder.create(bo).build(); |
50 | } | |
51 | ||
52 | /** | |
53 | * Converts a immutable object to its mutable counterpart | |
54 | * @param im immutable object | |
55 | * @return the mutable bo | |
56 | */ | |
57 | static ResponsibilityTemplateBo from(Template im) { | |
58 | 0 | if (im == null) { |
59 | 0 | return null |
60 | } | |
61 | ||
62 | 0 | ResponsibilityTemplateBo bo = new ResponsibilityTemplateBo() |
63 | 0 | bo.id = im.id |
64 | 0 | bo.namespaceCode = im.namespaceCode |
65 | 0 | bo.name = im.name |
66 | 0 | bo.description = im.description |
67 | 0 | bo.active = im.active |
68 | 0 | bo.kimTypeId = im.kimTypeId |
69 | 0 | bo.versionNumber = im.versionNumber |
70 | 0 | bo.objectId = im.objectId; |
71 | ||
72 | 0 | return bo |
73 | } | |
74 | } |