| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 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 | |
|
| 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 | |
} |