jakarta.xml.ns.persistence.orm.DiscriminatorColumn 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 jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
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}) @Retention(RUNTIME)
* public @interface DiscriminatorColumn {
* String name() default "DTYPE";
* DiscriminatorType discriminatorType() default STRING;
* String columnDefinition() default "";
* int length() default 31;
* }
*
* Java class for discriminator-column complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "discriminator-column")
public class DiscriminatorColumn implements Cloneable, CopyTo, Equals, HashCode, MergeFrom
{
@XmlAttribute(name = "name")
protected String name;
@XmlAttribute(name = "discriminator-type")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String discriminatorType;
@XmlAttribute(name = "column-definition")
protected String columnDefinition;
@XmlAttribute(name = "length")
protected Integer length;
/**
* 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 discriminatorType property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDiscriminatorType() {
return discriminatorType;
}
/**
* Sets the value of the discriminatorType property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDiscriminatorType(String value) {
this.discriminatorType = 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 length property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getLength() {
return length;
}
/**
* Sets the value of the length property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setLength(Integer value) {
this.length = 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 DiscriminatorColumn that = ((DiscriminatorColumn) 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 lhsDiscriminatorType;
lhsDiscriminatorType = this.getDiscriminatorType();
String rhsDiscriminatorType;
rhsDiscriminatorType = that.getDiscriminatorType();
if (!strategy.equals(LocatorUtils.property(thisLocator, "discriminatorType", lhsDiscriminatorType), LocatorUtils.property(thatLocator, "discriminatorType", rhsDiscriminatorType), lhsDiscriminatorType, rhsDiscriminatorType, (this.discriminatorType!= null), (that.discriminatorType!= 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;
}
}
{
Integer lhsLength;
lhsLength = this.getLength();
Integer rhsLength;
rhsLength = that.getLength();
if (!strategy.equals(LocatorUtils.property(thisLocator, "length", lhsLength), LocatorUtils.property(thatLocator, "length", rhsLength), lhsLength, rhsLength, (this.length!= null), (that.length!= 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 theDiscriminatorType;
theDiscriminatorType = this.getDiscriminatorType();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "discriminatorType", theDiscriminatorType), currentHashCode, theDiscriminatorType, (this.discriminatorType!= null));
}
{
String theColumnDefinition;
theColumnDefinition = this.getColumnDefinition();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "columnDefinition", theColumnDefinition), currentHashCode, theColumnDefinition, (this.columnDefinition!= null));
}
{
Integer theLength;
theLength = this.getLength();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "length", theLength), currentHashCode, theLength, (this.length!= 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 DiscriminatorColumn) {
final DiscriminatorColumn copy = ((DiscriminatorColumn) 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 discriminatorTypeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.discriminatorType!= null));
if (discriminatorTypeShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceDiscriminatorType;
sourceDiscriminatorType = this.getDiscriminatorType();
String copyDiscriminatorType = ((String) strategy.copy(LocatorUtils.property(locator, "discriminatorType", sourceDiscriminatorType), sourceDiscriminatorType, (this.discriminatorType!= null)));
copy.setDiscriminatorType(copyDiscriminatorType);
} else {
if (discriminatorTypeShouldBeCopiedAndSet == Boolean.FALSE) {
copy.discriminatorType = 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 lengthShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.length!= null));
if (lengthShouldBeCopiedAndSet == Boolean.TRUE) {
Integer sourceLength;
sourceLength = this.getLength();
Integer copyLength = ((Integer) strategy.copy(LocatorUtils.property(locator, "length", sourceLength), sourceLength, (this.length!= null)));
copy.setLength(copyLength);
} else {
if (lengthShouldBeCopiedAndSet == Boolean.FALSE) {
copy.length = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new DiscriminatorColumn();
}
@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 DiscriminatorColumn) {
final DiscriminatorColumn target = this;
final DiscriminatorColumn leftObject = ((DiscriminatorColumn) left);
final DiscriminatorColumn rightObject = ((DiscriminatorColumn) 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 discriminatorTypeShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.discriminatorType!= null), (rightObject.discriminatorType!= null));
if (discriminatorTypeShouldBeMergedAndSet == Boolean.TRUE) {
String lhsDiscriminatorType;
lhsDiscriminatorType = leftObject.getDiscriminatorType();
String rhsDiscriminatorType;
rhsDiscriminatorType = rightObject.getDiscriminatorType();
String mergedDiscriminatorType = ((String) strategy.merge(LocatorUtils.property(leftLocator, "discriminatorType", lhsDiscriminatorType), LocatorUtils.property(rightLocator, "discriminatorType", rhsDiscriminatorType), lhsDiscriminatorType, rhsDiscriminatorType, (leftObject.discriminatorType!= null), (rightObject.discriminatorType!= null)));
target.setDiscriminatorType(mergedDiscriminatorType);
} else {
if (discriminatorTypeShouldBeMergedAndSet == Boolean.FALSE) {
target.discriminatorType = 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 lengthShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.length!= null), (rightObject.length!= null));
if (lengthShouldBeMergedAndSet == Boolean.TRUE) {
Integer lhsLength;
lhsLength = leftObject.getLength();
Integer rhsLength;
rhsLength = rightObject.getLength();
Integer mergedLength = ((Integer) strategy.merge(LocatorUtils.property(leftLocator, "length", lhsLength), LocatorUtils.property(rightLocator, "length", rhsLength), lhsLength, rhsLength, (leftObject.length!= null), (rightObject.length!= null)));
target.setLength(mergedLength);
} else {
if (lengthShouldBeMergedAndSet == Boolean.FALSE) {
target.length = null;
}
}
}
}
}
}