View Javadoc

1   /**
2    * Copyright 2005-2013 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 permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.metadata;
17  
18  import javax.persistence.CascadeType;
19  
20  import org.apache.commons.lang.StringUtils;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  @Deprecated
26  public class OneToOneDescriptor extends ObjectDescriptor implements java.io.Serializable {
27  
28  	private static final long serialVersionUID = 5005807906661228700L;
29  
30  	private String mappedBy = "";
31  	
32  	public String getMappedBy() {
33  		return this.mappedBy;
34  	}
35  	
36  	public void setMappedBy(String mappedBy) {
37  		this.mappedBy = mappedBy;
38  	}
39  	
40  	public String toString() {
41  		StringBuffer sb = new StringBuffer();
42  		sb.append("OneToOneDescriptor = [ ");
43  		sb.append("targetEntity:").append(targetEntity.getName()).append(", ");
44  		sb.append("cascade = { ");
45  		for (CascadeType ct : cascade) {
46  			sb.append(ct).append(" ");
47  		}
48  		sb.append("}, ");
49  		sb.append("fetch:").append(fetch).append(", ");
50  		sb.append("optional:").append(optional);
51  		if (!StringUtils.isBlank(mappedBy)) {
52  			sb.append(", mappedBy:").append(mappedBy);
53  		}
54  		if (!joinColumnDescriptors.isEmpty()) {
55  			sb.append(", join columns = { ");
56  			for (JoinColumnDescriptor joinColumnDescriptor : joinColumnDescriptors) {				
57  				sb.append(" jc = { ");
58  				sb.append("name:").append(joinColumnDescriptor.getName()).append(", ");
59  				sb.append("insertable:").append(joinColumnDescriptor.isInsertable()).append(", ");
60  				sb.append("nullable:").append(joinColumnDescriptor.isNullable()).append(", ");
61  				sb.append("unique:").append(joinColumnDescriptor.isUnique()).append(", ");
62  				sb.append("updateable:").append(joinColumnDescriptor.isUpdateable());
63  				sb.append(" }");
64  			}
65  			sb.append(" } ");
66  		}
67  		sb.append(" ]");
68  		return sb.toString();
69  	}
70  	
71  }