jakarta.xml.ns.persistence.orm.JoinColumn Maven / Gradle / Ivy
//
// This file was generated by the Eclipse Implementation of JAXB, v4.0.5
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
//
package jakarta.xml.ns.persistence.orm;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlType;
import org.jvnet.jaxb.lang.CopyStrategy;
import org.jvnet.jaxb.lang.CopyTo;
import org.jvnet.jaxb.lang.Equals;
import org.jvnet.jaxb.lang.EqualsStrategy;
import org.jvnet.jaxb.lang.HashCode;
import org.jvnet.jaxb.lang.HashCodeStrategy;
import org.jvnet.jaxb.lang.JAXBCopyStrategy;
import org.jvnet.jaxb.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb.lang.JAXBHashCodeStrategy;
import org.jvnet.jaxb.lang.JAXBMergeStrategy;
import org.jvnet.jaxb.lang.MergeFrom;
import org.jvnet.jaxb.lang.MergeStrategy;
import org.jvnet.jaxb.locator.ObjectLocator;
import org.jvnet.jaxb.locator.util.LocatorUtils;
/**
* @Target({METHOD, FIELD}) @Retention(RUNTIME)
* public @interface JoinColumn {
* String name() default "";
* String referencedColumnName() default "";
* boolean unique() default false;
* boolean nullable() default true;
* boolean insertable() default true;
* boolean updatable() default true;
* String columnDefinition() default "";
* String table() default "";
* ForeignKey foreignKey() default @ForeignKey();
* }
*
* Java class for join-column complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "join-column")
public class JoinColumn implements Cloneable, CopyTo, Equals, HashCode, MergeFrom
{
@XmlAttribute(name = "name")
protected String name;
@XmlAttribute(name = "referenced-column-name")
protected String referencedColumnName;
@XmlAttribute(name = "unique")
protected Boolean unique;
@XmlAttribute(name = "nullable")
protected Boolean nullable;
@XmlAttribute(name = "insertable")
protected Boolean insertable;
@XmlAttribute(name = "updatable")
protected Boolean updatable;
@XmlAttribute(name = "column-definition")
protected String columnDefinition;
@XmlAttribute(name = "table")
protected String table;
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the referencedColumnName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getReferencedColumnName() {
return referencedColumnName;
}
/**
* Sets the value of the referencedColumnName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setReferencedColumnName(String value) {
this.referencedColumnName = value;
}
/**
* Gets the value of the unique property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isUnique() {
return unique;
}
/**
* Sets the value of the unique property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setUnique(Boolean value) {
this.unique = value;
}
/**
* Gets the value of the nullable property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isNullable() {
return nullable;
}
/**
* Sets the value of the nullable property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setNullable(Boolean value) {
this.nullable = value;
}
/**
* Gets the value of the insertable property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isInsertable() {
return insertable;
}
/**
* Sets the value of the insertable property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setInsertable(Boolean value) {
this.insertable = value;
}
/**
* Gets the value of the updatable property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isUpdatable() {
return updatable;
}
/**
* Sets the value of the updatable property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setUpdatable(Boolean value) {
this.updatable = value;
}
/**
* Gets the value of the columnDefinition property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getColumnDefinition() {
return columnDefinition;
}
/**
* Sets the value of the columnDefinition property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setColumnDefinition(String value) {
this.columnDefinition = value;
}
/**
* Gets the value of the table property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTable() {
return table;
}
/**
* Sets the value of the table property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTable(String value) {
this.table = value;
}
@Override
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final JoinColumn that = ((JoinColumn) object);
{
String lhsName;
lhsName = this.getName();
String rhsName;
rhsName = that.getName();
if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName, (this.name!= null), (that.name!= null))) {
return false;
}
}
{
String lhsReferencedColumnName;
lhsReferencedColumnName = this.getReferencedColumnName();
String rhsReferencedColumnName;
rhsReferencedColumnName = that.getReferencedColumnName();
if (!strategy.equals(LocatorUtils.property(thisLocator, "referencedColumnName", lhsReferencedColumnName), LocatorUtils.property(thatLocator, "referencedColumnName", rhsReferencedColumnName), lhsReferencedColumnName, rhsReferencedColumnName, (this.referencedColumnName!= null), (that.referencedColumnName!= null))) {
return false;
}
}
{
Boolean lhsUnique;
lhsUnique = this.isUnique();
Boolean rhsUnique;
rhsUnique = that.isUnique();
if (!strategy.equals(LocatorUtils.property(thisLocator, "unique", lhsUnique), LocatorUtils.property(thatLocator, "unique", rhsUnique), lhsUnique, rhsUnique, (this.unique!= null), (that.unique!= null))) {
return false;
}
}
{
Boolean lhsNullable;
lhsNullable = this.isNullable();
Boolean rhsNullable;
rhsNullable = that.isNullable();
if (!strategy.equals(LocatorUtils.property(thisLocator, "nullable", lhsNullable), LocatorUtils.property(thatLocator, "nullable", rhsNullable), lhsNullable, rhsNullable, (this.nullable!= null), (that.nullable!= null))) {
return false;
}
}
{
Boolean lhsInsertable;
lhsInsertable = this.isInsertable();
Boolean rhsInsertable;
rhsInsertable = that.isInsertable();
if (!strategy.equals(LocatorUtils.property(thisLocator, "insertable", lhsInsertable), LocatorUtils.property(thatLocator, "insertable", rhsInsertable), lhsInsertable, rhsInsertable, (this.insertable!= null), (that.insertable!= null))) {
return false;
}
}
{
Boolean lhsUpdatable;
lhsUpdatable = this.isUpdatable();
Boolean rhsUpdatable;
rhsUpdatable = that.isUpdatable();
if (!strategy.equals(LocatorUtils.property(thisLocator, "updatable", lhsUpdatable), LocatorUtils.property(thatLocator, "updatable", rhsUpdatable), lhsUpdatable, rhsUpdatable, (this.updatable!= null), (that.updatable!= null))) {
return false;
}
}
{
String lhsColumnDefinition;
lhsColumnDefinition = this.getColumnDefinition();
String rhsColumnDefinition;
rhsColumnDefinition = that.getColumnDefinition();
if (!strategy.equals(LocatorUtils.property(thisLocator, "columnDefinition", lhsColumnDefinition), LocatorUtils.property(thatLocator, "columnDefinition", rhsColumnDefinition), lhsColumnDefinition, rhsColumnDefinition, (this.columnDefinition!= null), (that.columnDefinition!= null))) {
return false;
}
}
{
String lhsTable;
lhsTable = this.getTable();
String rhsTable;
rhsTable = that.getTable();
if (!strategy.equals(LocatorUtils.property(thisLocator, "table", lhsTable), LocatorUtils.property(thatLocator, "table", rhsTable), lhsTable, rhsTable, (this.table!= null), (that.table!= null))) {
return false;
}
}
return true;
}
@Override
public boolean equals(Object object) {
final EqualsStrategy strategy = JAXBEqualsStrategy.getInstance();
return equals(null, null, object, strategy);
}
@Override
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
int currentHashCode = 1;
{
String theName;
theName = this.getName();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName, (this.name!= null));
}
{
String theReferencedColumnName;
theReferencedColumnName = this.getReferencedColumnName();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "referencedColumnName", theReferencedColumnName), currentHashCode, theReferencedColumnName, (this.referencedColumnName!= null));
}
{
Boolean theUnique;
theUnique = this.isUnique();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "unique", theUnique), currentHashCode, theUnique, (this.unique!= null));
}
{
Boolean theNullable;
theNullable = this.isNullable();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "nullable", theNullable), currentHashCode, theNullable, (this.nullable!= null));
}
{
Boolean theInsertable;
theInsertable = this.isInsertable();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "insertable", theInsertable), currentHashCode, theInsertable, (this.insertable!= null));
}
{
Boolean theUpdatable;
theUpdatable = this.isUpdatable();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "updatable", theUpdatable), currentHashCode, theUpdatable, (this.updatable!= null));
}
{
String theColumnDefinition;
theColumnDefinition = this.getColumnDefinition();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "columnDefinition", theColumnDefinition), currentHashCode, theColumnDefinition, (this.columnDefinition!= null));
}
{
String theTable;
theTable = this.getTable();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "table", theTable), currentHashCode, theTable, (this.table!= null));
}
return currentHashCode;
}
@Override
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.getInstance();
return this.hashCode(null, strategy);
}
@Override
public Object clone() {
return copyTo(createNewInstance());
}
@Override
public Object copyTo(Object target) {
final CopyStrategy strategy = JAXBCopyStrategy.getInstance();
return copyTo(null, target, strategy);
}
@Override
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy strategy) {
final Object draftCopy = ((target == null)?createNewInstance():target);
if (draftCopy instanceof JoinColumn) {
final JoinColumn copy = ((JoinColumn) draftCopy);
{
Boolean nameShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.name!= null));
if (nameShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceName;
sourceName = this.getName();
String copyName = ((String) strategy.copy(LocatorUtils.property(locator, "name", sourceName), sourceName, (this.name!= null)));
copy.setName(copyName);
} else {
if (nameShouldBeCopiedAndSet == Boolean.FALSE) {
copy.name = null;
}
}
}
{
Boolean referencedColumnNameShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.referencedColumnName!= null));
if (referencedColumnNameShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceReferencedColumnName;
sourceReferencedColumnName = this.getReferencedColumnName();
String copyReferencedColumnName = ((String) strategy.copy(LocatorUtils.property(locator, "referencedColumnName", sourceReferencedColumnName), sourceReferencedColumnName, (this.referencedColumnName!= null)));
copy.setReferencedColumnName(copyReferencedColumnName);
} else {
if (referencedColumnNameShouldBeCopiedAndSet == Boolean.FALSE) {
copy.referencedColumnName = null;
}
}
}
{
Boolean uniqueShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.unique!= null));
if (uniqueShouldBeCopiedAndSet == Boolean.TRUE) {
Boolean sourceUnique;
sourceUnique = this.isUnique();
Boolean copyUnique = ((Boolean) strategy.copy(LocatorUtils.property(locator, "unique", sourceUnique), sourceUnique, (this.unique!= null)));
copy.setUnique(copyUnique);
} else {
if (uniqueShouldBeCopiedAndSet == Boolean.FALSE) {
copy.unique = null;
}
}
}
{
Boolean nullableShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.nullable!= null));
if (nullableShouldBeCopiedAndSet == Boolean.TRUE) {
Boolean sourceNullable;
sourceNullable = this.isNullable();
Boolean copyNullable = ((Boolean) strategy.copy(LocatorUtils.property(locator, "nullable", sourceNullable), sourceNullable, (this.nullable!= null)));
copy.setNullable(copyNullable);
} else {
if (nullableShouldBeCopiedAndSet == Boolean.FALSE) {
copy.nullable = null;
}
}
}
{
Boolean insertableShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.insertable!= null));
if (insertableShouldBeCopiedAndSet == Boolean.TRUE) {
Boolean sourceInsertable;
sourceInsertable = this.isInsertable();
Boolean copyInsertable = ((Boolean) strategy.copy(LocatorUtils.property(locator, "insertable", sourceInsertable), sourceInsertable, (this.insertable!= null)));
copy.setInsertable(copyInsertable);
} else {
if (insertableShouldBeCopiedAndSet == Boolean.FALSE) {
copy.insertable = null;
}
}
}
{
Boolean updatableShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.updatable!= null));
if (updatableShouldBeCopiedAndSet == Boolean.TRUE) {
Boolean sourceUpdatable;
sourceUpdatable = this.isUpdatable();
Boolean copyUpdatable = ((Boolean) strategy.copy(LocatorUtils.property(locator, "updatable", sourceUpdatable), sourceUpdatable, (this.updatable!= null)));
copy.setUpdatable(copyUpdatable);
} else {
if (updatableShouldBeCopiedAndSet == Boolean.FALSE) {
copy.updatable = null;
}
}
}
{
Boolean columnDefinitionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.columnDefinition!= null));
if (columnDefinitionShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceColumnDefinition;
sourceColumnDefinition = this.getColumnDefinition();
String copyColumnDefinition = ((String) strategy.copy(LocatorUtils.property(locator, "columnDefinition", sourceColumnDefinition), sourceColumnDefinition, (this.columnDefinition!= null)));
copy.setColumnDefinition(copyColumnDefinition);
} else {
if (columnDefinitionShouldBeCopiedAndSet == Boolean.FALSE) {
copy.columnDefinition = null;
}
}
}
{
Boolean tableShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.table!= null));
if (tableShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceTable;
sourceTable = this.getTable();
String copyTable = ((String) strategy.copy(LocatorUtils.property(locator, "table", sourceTable), sourceTable, (this.table!= null)));
copy.setTable(copyTable);
} else {
if (tableShouldBeCopiedAndSet == Boolean.FALSE) {
copy.table = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new JoinColumn();
}
@Override
public void mergeFrom(Object left, Object right) {
final MergeStrategy strategy = JAXBMergeStrategy.getInstance();
mergeFrom(null, null, left, right, strategy);
}
@Override
public void mergeFrom(ObjectLocator leftLocator, ObjectLocator rightLocator, Object left, Object right, MergeStrategy strategy) {
if (right instanceof JoinColumn) {
final JoinColumn target = this;
final JoinColumn leftObject = ((JoinColumn) left);
final JoinColumn rightObject = ((JoinColumn) right);
{
Boolean nameShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.name!= null), (rightObject.name!= null));
if (nameShouldBeMergedAndSet == Boolean.TRUE) {
String lhsName;
lhsName = leftObject.getName();
String rhsName;
rhsName = rightObject.getName();
String mergedName = ((String) strategy.merge(LocatorUtils.property(leftLocator, "name", lhsName), LocatorUtils.property(rightLocator, "name", rhsName), lhsName, rhsName, (leftObject.name!= null), (rightObject.name!= null)));
target.setName(mergedName);
} else {
if (nameShouldBeMergedAndSet == Boolean.FALSE) {
target.name = null;
}
}
}
{
Boolean referencedColumnNameShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.referencedColumnName!= null), (rightObject.referencedColumnName!= null));
if (referencedColumnNameShouldBeMergedAndSet == Boolean.TRUE) {
String lhsReferencedColumnName;
lhsReferencedColumnName = leftObject.getReferencedColumnName();
String rhsReferencedColumnName;
rhsReferencedColumnName = rightObject.getReferencedColumnName();
String mergedReferencedColumnName = ((String) strategy.merge(LocatorUtils.property(leftLocator, "referencedColumnName", lhsReferencedColumnName), LocatorUtils.property(rightLocator, "referencedColumnName", rhsReferencedColumnName), lhsReferencedColumnName, rhsReferencedColumnName, (leftObject.referencedColumnName!= null), (rightObject.referencedColumnName!= null)));
target.setReferencedColumnName(mergedReferencedColumnName);
} else {
if (referencedColumnNameShouldBeMergedAndSet == Boolean.FALSE) {
target.referencedColumnName = null;
}
}
}
{
Boolean uniqueShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.unique!= null), (rightObject.unique!= null));
if (uniqueShouldBeMergedAndSet == Boolean.TRUE) {
Boolean lhsUnique;
lhsUnique = leftObject.isUnique();
Boolean rhsUnique;
rhsUnique = rightObject.isUnique();
Boolean mergedUnique = ((Boolean) strategy.merge(LocatorUtils.property(leftLocator, "unique", lhsUnique), LocatorUtils.property(rightLocator, "unique", rhsUnique), lhsUnique, rhsUnique, (leftObject.unique!= null), (rightObject.unique!= null)));
target.setUnique(mergedUnique);
} else {
if (uniqueShouldBeMergedAndSet == Boolean.FALSE) {
target.unique = null;
}
}
}
{
Boolean nullableShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.nullable!= null), (rightObject.nullable!= null));
if (nullableShouldBeMergedAndSet == Boolean.TRUE) {
Boolean lhsNullable;
lhsNullable = leftObject.isNullable();
Boolean rhsNullable;
rhsNullable = rightObject.isNullable();
Boolean mergedNullable = ((Boolean) strategy.merge(LocatorUtils.property(leftLocator, "nullable", lhsNullable), LocatorUtils.property(rightLocator, "nullable", rhsNullable), lhsNullable, rhsNullable, (leftObject.nullable!= null), (rightObject.nullable!= null)));
target.setNullable(mergedNullable);
} else {
if (nullableShouldBeMergedAndSet == Boolean.FALSE) {
target.nullable = null;
}
}
}
{
Boolean insertableShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.insertable!= null), (rightObject.insertable!= null));
if (insertableShouldBeMergedAndSet == Boolean.TRUE) {
Boolean lhsInsertable;
lhsInsertable = leftObject.isInsertable();
Boolean rhsInsertable;
rhsInsertable = rightObject.isInsertable();
Boolean mergedInsertable = ((Boolean) strategy.merge(LocatorUtils.property(leftLocator, "insertable", lhsInsertable), LocatorUtils.property(rightLocator, "insertable", rhsInsertable), lhsInsertable, rhsInsertable, (leftObject.insertable!= null), (rightObject.insertable!= null)));
target.setInsertable(mergedInsertable);
} else {
if (insertableShouldBeMergedAndSet == Boolean.FALSE) {
target.insertable = null;
}
}
}
{
Boolean updatableShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.updatable!= null), (rightObject.updatable!= null));
if (updatableShouldBeMergedAndSet == Boolean.TRUE) {
Boolean lhsUpdatable;
lhsUpdatable = leftObject.isUpdatable();
Boolean rhsUpdatable;
rhsUpdatable = rightObject.isUpdatable();
Boolean mergedUpdatable = ((Boolean) strategy.merge(LocatorUtils.property(leftLocator, "updatable", lhsUpdatable), LocatorUtils.property(rightLocator, "updatable", rhsUpdatable), lhsUpdatable, rhsUpdatable, (leftObject.updatable!= null), (rightObject.updatable!= null)));
target.setUpdatable(mergedUpdatable);
} else {
if (updatableShouldBeMergedAndSet == Boolean.FALSE) {
target.updatable = null;
}
}
}
{
Boolean columnDefinitionShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.columnDefinition!= null), (rightObject.columnDefinition!= null));
if (columnDefinitionShouldBeMergedAndSet == Boolean.TRUE) {
String lhsColumnDefinition;
lhsColumnDefinition = leftObject.getColumnDefinition();
String rhsColumnDefinition;
rhsColumnDefinition = rightObject.getColumnDefinition();
String mergedColumnDefinition = ((String) strategy.merge(LocatorUtils.property(leftLocator, "columnDefinition", lhsColumnDefinition), LocatorUtils.property(rightLocator, "columnDefinition", rhsColumnDefinition), lhsColumnDefinition, rhsColumnDefinition, (leftObject.columnDefinition!= null), (rightObject.columnDefinition!= null)));
target.setColumnDefinition(mergedColumnDefinition);
} else {
if (columnDefinitionShouldBeMergedAndSet == Boolean.FALSE) {
target.columnDefinition = null;
}
}
}
{
Boolean tableShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.table!= null), (rightObject.table!= null));
if (tableShouldBeMergedAndSet == Boolean.TRUE) {
String lhsTable;
lhsTable = leftObject.getTable();
String rhsTable;
rhsTable = rightObject.getTable();
String mergedTable = ((String) strategy.merge(LocatorUtils.property(leftLocator, "table", lhsTable), LocatorUtils.property(rightLocator, "table", rhsTable), lhsTable, rhsTable, (leftObject.table!= null), (rightObject.table!= null)));
target.setTable(mergedTable);
} else {
if (tableShouldBeMergedAndSet == Boolean.FALSE) {
target.table = null;
}
}
}
}
}
}