jakarta.xml.ns.persistence.orm.AssociationOverride 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 java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
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({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
* public @interface AssociationOverride {
* String name();
* JoinColumn[] joinColumns() default{};
* JoinTable joinTable() default @JoinTable;
* }
*
* Java class for association-override complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "association-override", propOrder = {
"description",
"joinColumn",
"foreignKey",
"joinTable"
})
public class AssociationOverride implements Cloneable, CopyTo, Equals, HashCode, MergeFrom
{
protected String description;
@XmlElement(name = "join-column")
protected List joinColumn;
@XmlElement(name = "foreign-key")
protected ForeignKey foreignKey;
@XmlElement(name = "join-table")
protected JoinTable joinTable;
@XmlAttribute(name = "name", required = true)
protected String name;
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Gets the value of the joinColumn property.
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a set
method for the joinColumn property.
*
*
* For example, to add a new item, do as follows:
*
*
* getJoinColumn().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link JoinColumn }
*
*
*
* @return
* The value of the joinColumn property.
*/
public List getJoinColumn() {
if (joinColumn == null) {
joinColumn = new ArrayList<>();
}
return this.joinColumn;
}
/**
* Gets the value of the foreignKey property.
*
* @return
* possible object is
* {@link ForeignKey }
*
*/
public ForeignKey getForeignKey() {
return foreignKey;
}
/**
* Sets the value of the foreignKey property.
*
* @param value
* allowed object is
* {@link ForeignKey }
*
*/
public void setForeignKey(ForeignKey value) {
this.foreignKey = value;
}
/**
* Gets the value of the joinTable property.
*
* @return
* possible object is
* {@link JoinTable }
*
*/
public JoinTable getJoinTable() {
return joinTable;
}
/**
* Sets the value of the joinTable property.
*
* @param value
* allowed object is
* {@link JoinTable }
*
*/
public void setJoinTable(JoinTable value) {
this.joinTable = value;
}
/**
* 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;
}
@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 AssociationOverride that = ((AssociationOverride) object);
{
String lhsDescription;
lhsDescription = this.getDescription();
String rhsDescription;
rhsDescription = that.getDescription();
if (!strategy.equals(LocatorUtils.property(thisLocator, "description", lhsDescription), LocatorUtils.property(thatLocator, "description", rhsDescription), lhsDescription, rhsDescription, (this.description!= null), (that.description!= null))) {
return false;
}
}
{
List lhsJoinColumn;
lhsJoinColumn = (((this.joinColumn!= null)&&(!this.joinColumn.isEmpty()))?this.getJoinColumn():null);
List rhsJoinColumn;
rhsJoinColumn = (((that.joinColumn!= null)&&(!that.joinColumn.isEmpty()))?that.getJoinColumn():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "joinColumn", lhsJoinColumn), LocatorUtils.property(thatLocator, "joinColumn", rhsJoinColumn), lhsJoinColumn, rhsJoinColumn, ((this.joinColumn!= null)&&(!this.joinColumn.isEmpty())), ((that.joinColumn!= null)&&(!that.joinColumn.isEmpty())))) {
return false;
}
}
{
ForeignKey lhsForeignKey;
lhsForeignKey = this.getForeignKey();
ForeignKey rhsForeignKey;
rhsForeignKey = that.getForeignKey();
if (!strategy.equals(LocatorUtils.property(thisLocator, "foreignKey", lhsForeignKey), LocatorUtils.property(thatLocator, "foreignKey", rhsForeignKey), lhsForeignKey, rhsForeignKey, (this.foreignKey!= null), (that.foreignKey!= null))) {
return false;
}
}
{
JoinTable lhsJoinTable;
lhsJoinTable = this.getJoinTable();
JoinTable rhsJoinTable;
rhsJoinTable = that.getJoinTable();
if (!strategy.equals(LocatorUtils.property(thisLocator, "joinTable", lhsJoinTable), LocatorUtils.property(thatLocator, "joinTable", rhsJoinTable), lhsJoinTable, rhsJoinTable, (this.joinTable!= null), (that.joinTable!= null))) {
return false;
}
}
{
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;
}
}
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 theDescription;
theDescription = this.getDescription();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "description", theDescription), currentHashCode, theDescription, (this.description!= null));
}
{
List theJoinColumn;
theJoinColumn = (((this.joinColumn!= null)&&(!this.joinColumn.isEmpty()))?this.getJoinColumn():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "joinColumn", theJoinColumn), currentHashCode, theJoinColumn, ((this.joinColumn!= null)&&(!this.joinColumn.isEmpty())));
}
{
ForeignKey theForeignKey;
theForeignKey = this.getForeignKey();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "foreignKey", theForeignKey), currentHashCode, theForeignKey, (this.foreignKey!= null));
}
{
JoinTable theJoinTable;
theJoinTable = this.getJoinTable();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "joinTable", theJoinTable), currentHashCode, theJoinTable, (this.joinTable!= null));
}
{
String theName;
theName = this.getName();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName, (this.name!= 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 AssociationOverride) {
final AssociationOverride copy = ((AssociationOverride) draftCopy);
{
Boolean descriptionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.description!= null));
if (descriptionShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceDescription;
sourceDescription = this.getDescription();
String copyDescription = ((String) strategy.copy(LocatorUtils.property(locator, "description", sourceDescription), sourceDescription, (this.description!= null)));
copy.setDescription(copyDescription);
} else {
if (descriptionShouldBeCopiedAndSet == Boolean.FALSE) {
copy.description = null;
}
}
}
{
Boolean joinColumnShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.joinColumn!= null)&&(!this.joinColumn.isEmpty())));
if (joinColumnShouldBeCopiedAndSet == Boolean.TRUE) {
List sourceJoinColumn;
sourceJoinColumn = (((this.joinColumn!= null)&&(!this.joinColumn.isEmpty()))?this.getJoinColumn():null);
@SuppressWarnings("unchecked")
List copyJoinColumn = ((List ) strategy.copy(LocatorUtils.property(locator, "joinColumn", sourceJoinColumn), sourceJoinColumn, ((this.joinColumn!= null)&&(!this.joinColumn.isEmpty()))));
copy.joinColumn = null;
if (copyJoinColumn!= null) {
List uniqueJoinColumnl = copy.getJoinColumn();
uniqueJoinColumnl.addAll(copyJoinColumn);
}
} else {
if (joinColumnShouldBeCopiedAndSet == Boolean.FALSE) {
copy.joinColumn = null;
}
}
}
{
Boolean foreignKeyShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.foreignKey!= null));
if (foreignKeyShouldBeCopiedAndSet == Boolean.TRUE) {
ForeignKey sourceForeignKey;
sourceForeignKey = this.getForeignKey();
ForeignKey copyForeignKey = ((ForeignKey) strategy.copy(LocatorUtils.property(locator, "foreignKey", sourceForeignKey), sourceForeignKey, (this.foreignKey!= null)));
copy.setForeignKey(copyForeignKey);
} else {
if (foreignKeyShouldBeCopiedAndSet == Boolean.FALSE) {
copy.foreignKey = null;
}
}
}
{
Boolean joinTableShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.joinTable!= null));
if (joinTableShouldBeCopiedAndSet == Boolean.TRUE) {
JoinTable sourceJoinTable;
sourceJoinTable = this.getJoinTable();
JoinTable copyJoinTable = ((JoinTable) strategy.copy(LocatorUtils.property(locator, "joinTable", sourceJoinTable), sourceJoinTable, (this.joinTable!= null)));
copy.setJoinTable(copyJoinTable);
} else {
if (joinTableShouldBeCopiedAndSet == Boolean.FALSE) {
copy.joinTable = null;
}
}
}
{
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;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new AssociationOverride();
}
@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 AssociationOverride) {
final AssociationOverride target = this;
final AssociationOverride leftObject = ((AssociationOverride) left);
final AssociationOverride rightObject = ((AssociationOverride) right);
{
Boolean descriptionShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.description!= null), (rightObject.description!= null));
if (descriptionShouldBeMergedAndSet == Boolean.TRUE) {
String lhsDescription;
lhsDescription = leftObject.getDescription();
String rhsDescription;
rhsDescription = rightObject.getDescription();
String mergedDescription = ((String) strategy.merge(LocatorUtils.property(leftLocator, "description", lhsDescription), LocatorUtils.property(rightLocator, "description", rhsDescription), lhsDescription, rhsDescription, (leftObject.description!= null), (rightObject.description!= null)));
target.setDescription(mergedDescription);
} else {
if (descriptionShouldBeMergedAndSet == Boolean.FALSE) {
target.description = null;
}
}
}
{
Boolean joinColumnShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, ((leftObject.joinColumn!= null)&&(!leftObject.joinColumn.isEmpty())), ((rightObject.joinColumn!= null)&&(!rightObject.joinColumn.isEmpty())));
if (joinColumnShouldBeMergedAndSet == Boolean.TRUE) {
List lhsJoinColumn;
lhsJoinColumn = (((leftObject.joinColumn!= null)&&(!leftObject.joinColumn.isEmpty()))?leftObject.getJoinColumn():null);
List rhsJoinColumn;
rhsJoinColumn = (((rightObject.joinColumn!= null)&&(!rightObject.joinColumn.isEmpty()))?rightObject.getJoinColumn():null);
List mergedJoinColumn = ((List ) strategy.merge(LocatorUtils.property(leftLocator, "joinColumn", lhsJoinColumn), LocatorUtils.property(rightLocator, "joinColumn", rhsJoinColumn), lhsJoinColumn, rhsJoinColumn, ((leftObject.joinColumn!= null)&&(!leftObject.joinColumn.isEmpty())), ((rightObject.joinColumn!= null)&&(!rightObject.joinColumn.isEmpty()))));
target.joinColumn = null;
if (mergedJoinColumn!= null) {
List uniqueJoinColumnl = target.getJoinColumn();
uniqueJoinColumnl.addAll(mergedJoinColumn);
}
} else {
if (joinColumnShouldBeMergedAndSet == Boolean.FALSE) {
target.joinColumn = null;
}
}
}
{
Boolean foreignKeyShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.foreignKey!= null), (rightObject.foreignKey!= null));
if (foreignKeyShouldBeMergedAndSet == Boolean.TRUE) {
ForeignKey lhsForeignKey;
lhsForeignKey = leftObject.getForeignKey();
ForeignKey rhsForeignKey;
rhsForeignKey = rightObject.getForeignKey();
ForeignKey mergedForeignKey = ((ForeignKey) strategy.merge(LocatorUtils.property(leftLocator, "foreignKey", lhsForeignKey), LocatorUtils.property(rightLocator, "foreignKey", rhsForeignKey), lhsForeignKey, rhsForeignKey, (leftObject.foreignKey!= null), (rightObject.foreignKey!= null)));
target.setForeignKey(mergedForeignKey);
} else {
if (foreignKeyShouldBeMergedAndSet == Boolean.FALSE) {
target.foreignKey = null;
}
}
}
{
Boolean joinTableShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.joinTable!= null), (rightObject.joinTable!= null));
if (joinTableShouldBeMergedAndSet == Boolean.TRUE) {
JoinTable lhsJoinTable;
lhsJoinTable = leftObject.getJoinTable();
JoinTable rhsJoinTable;
rhsJoinTable = rightObject.getJoinTable();
JoinTable mergedJoinTable = ((JoinTable) strategy.merge(LocatorUtils.property(leftLocator, "joinTable", lhsJoinTable), LocatorUtils.property(rightLocator, "joinTable", rhsJoinTable), lhsJoinTable, rhsJoinTable, (leftObject.joinTable!= null), (rightObject.joinTable!= null)));
target.setJoinTable(mergedJoinTable);
} else {
if (joinTableShouldBeMergedAndSet == Boolean.FALSE) {
target.joinTable = null;
}
}
}
{
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;
}
}
}
}
}
}