Coverage Report - org.kuali.rice.core.jpa.metadata.OneToOneDescriptor
 
Classes in this File Line Coverage Branch Coverage Complexity
OneToOneDescriptor
0%
0/29
0%
0/8
2.333
 
 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 permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.core.jpa.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  0
 public class OneToOneDescriptor extends ObjectDescriptor implements java.io.Serializable {
 26  
 
 27  
         private static final long serialVersionUID = 5005807906661228700L;
 28  
 
 29  0
         private String mappedBy = "";
 30  
         
 31  
         public String getMappedBy() {
 32  0
                 return this.mappedBy;
 33  
         }
 34  
         
 35  
         public void setMappedBy(String mappedBy) {
 36  0
                 this.mappedBy = mappedBy;
 37  0
         }
 38  
         
 39  
         public String toString() {
 40  0
                 StringBuffer sb = new StringBuffer();
 41  0
                 sb.append("OneToOneDescriptor = [ ");
 42  0
                 sb.append("targetEntity:").append(targetEntity.getName()).append(", ");
 43  0
                 sb.append("cascade = { ");
 44  0
                 for (CascadeType ct : cascade) {
 45  0
                         sb.append(ct).append(" ");
 46  
                 }
 47  0
                 sb.append("}, ");
 48  0
                 sb.append("fetch:").append(fetch).append(", ");
 49  0
                 sb.append("optional:").append(optional);
 50  0
                 if (!StringUtils.isBlank(mappedBy)) {
 51  0
                         sb.append(", mappedBy:").append(mappedBy);
 52  
                 }
 53  0
                 if (!joinColumnDescriptors.isEmpty()) {
 54  0
                         sb.append(", join columns = { ");
 55  0
                         for (JoinColumnDescriptor joinColumnDescriptor : joinColumnDescriptors) {                                
 56  0
                                 sb.append(" jc = { ");
 57  0
                                 sb.append("name:").append(joinColumnDescriptor.getName()).append(", ");
 58  0
                                 sb.append("insertable:").append(joinColumnDescriptor.isInsertable()).append(", ");
 59  0
                                 sb.append("nullable:").append(joinColumnDescriptor.isNullable()).append(", ");
 60  0
                                 sb.append("unique:").append(joinColumnDescriptor.isUnique()).append(", ");
 61  0
                                 sb.append("updateable:").append(joinColumnDescriptor.isUpdateable());
 62  0
                                 sb.append(" }");
 63  
                         }
 64  0
                         sb.append(" } ");
 65  
                 }
 66  0
                 sb.append(" ]");
 67  0
                 return sb.toString();
 68  
         }
 69  
         
 70  
 }