org.jvnet.hyperjaxb3.ejb.schemas.customizations.ManyToOne 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 org.jvnet.hyperjaxb3.ejb.schemas.customizations;
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;
/**
* Java class for many-to-one complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "many-to-one")
public class ManyToOne
extends jakarta.xml.ns.persistence.orm.ManyToOne
implements Cloneable, Mergeable, CopyTo, Equals, HashCode, MergeFrom
{
@XmlAttribute(name = "merge")
protected Boolean merge;
/**
* Gets the value of the merge property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public boolean isMerge() {
if (merge == null) {
return true;
} else {
return merge;
}
}
/**
* Sets the value of the merge property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setMerge(Boolean value) {
this.merge = 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;
}
if (!super.equals(thisLocator, thatLocator, object, strategy)) {
return false;
}
final ManyToOne that = ((ManyToOne) object);
{
boolean lhsMerge;
lhsMerge = ((this.merge!= null)?this.isMerge():true);
boolean rhsMerge;
rhsMerge = ((that.merge!= null)?that.isMerge():true);
if (!strategy.equals(LocatorUtils.property(thisLocator, "merge", lhsMerge), LocatorUtils.property(thatLocator, "merge", rhsMerge), lhsMerge, rhsMerge, (this.merge!= null), (that.merge!= 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 = super.hashCode(locator, strategy);
{
boolean theMerge;
theMerge = ((this.merge!= null)?this.isMerge():true);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "merge", theMerge), currentHashCode, theMerge, (this.merge!= 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);
super.copyTo(locator, draftCopy, strategy);
if (draftCopy instanceof ManyToOne) {
final ManyToOne copy = ((ManyToOne) draftCopy);
{
Boolean mergeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.merge!= null));
if (mergeShouldBeCopiedAndSet == Boolean.TRUE) {
boolean sourceMerge;
sourceMerge = ((this.merge!= null)?this.isMerge():true);
boolean copyMerge = strategy.copy(LocatorUtils.property(locator, "merge", sourceMerge), sourceMerge, (this.merge!= null));
copy.setMerge(copyMerge);
} else {
if (mergeShouldBeCopiedAndSet == Boolean.FALSE) {
copy.merge = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new ManyToOne();
}
@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) {
super.mergeFrom(leftLocator, rightLocator, left, right, strategy);
if (right instanceof ManyToOne) {
final ManyToOne target = this;
final ManyToOne leftObject = ((ManyToOne) left);
final ManyToOne rightObject = ((ManyToOne) right);
{
Boolean mergeShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.merge!= null), (rightObject.merge!= null));
if (mergeShouldBeMergedAndSet == Boolean.TRUE) {
boolean lhsMerge;
lhsMerge = ((leftObject.merge!= null)?leftObject.isMerge():true);
boolean rhsMerge;
rhsMerge = ((rightObject.merge!= null)?rightObject.isMerge():true);
boolean mergedMerge = ((boolean) strategy.merge(LocatorUtils.property(leftLocator, "merge", lhsMerge), LocatorUtils.property(rightLocator, "merge", rhsMerge), lhsMerge, rhsMerge, (leftObject.merge!= null), (rightObject.merge!= null)));
target.setMerge(mergedMerge);
} else {
if (mergeShouldBeMergedAndSet == Boolean.FALSE) {
target.merge = null;
}
}
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy