jakarta.xml.ns.persistence.orm.GeneratedValue 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({METHOD, FIELD}) @Retention(RUNTIME)
* public @interface GeneratedValue {
* GenerationType strategy() default AUTO;
* String generator() default "";
* }
*
* Java class for generated-value complex type
.
*
* The following schema fragment specifies the expected content contained within this class.
*
* {@code
*
*
*
*
*
*
*
*
* }
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "generated-value")
public class GeneratedValue implements Cloneable, CopyTo, Equals, HashCode, MergeFrom
{
@XmlAttribute(name = "strategy")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String strategy;
@XmlAttribute(name = "generator")
protected String generator;
/**
* Gets the value of the strategy property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getStrategy() {
return strategy;
}
/**
* Sets the value of the strategy property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setStrategy(String value) {
this.strategy = value;
}
/**
* Gets the value of the generator property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getGenerator() {
return generator;
}
/**
* Sets the value of the generator property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setGenerator(String value) {
this.generator = 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 GeneratedValue that = ((GeneratedValue) object);
{
String lhsStrategy;
lhsStrategy = this.getStrategy();
String rhsStrategy;
rhsStrategy = that.getStrategy();
if (!strategy.equals(LocatorUtils.property(thisLocator, "strategy", lhsStrategy), LocatorUtils.property(thatLocator, "strategy", rhsStrategy), lhsStrategy, rhsStrategy, (this.strategy!= null), (that.strategy!= null))) {
return false;
}
}
{
String lhsGenerator;
lhsGenerator = this.getGenerator();
String rhsGenerator;
rhsGenerator = that.getGenerator();
if (!strategy.equals(LocatorUtils.property(thisLocator, "generator", lhsGenerator), LocatorUtils.property(thatLocator, "generator", rhsGenerator), lhsGenerator, rhsGenerator, (this.generator!= null), (that.generator!= 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 theStrategy;
theStrategy = this.getStrategy();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "strategy", theStrategy), currentHashCode, theStrategy, (this.strategy!= null));
}
{
String theGenerator;
theGenerator = this.getGenerator();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "generator", theGenerator), currentHashCode, theGenerator, (this.generator!= 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 GeneratedValue) {
final GeneratedValue copy = ((GeneratedValue) draftCopy);
{
Boolean strategyShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.strategy!= null));
if (strategyShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceStrategy;
sourceStrategy = this.getStrategy();
String copyStrategy = ((String) strategy.copy(LocatorUtils.property(locator, "strategy", sourceStrategy), sourceStrategy, (this.strategy!= null)));
copy.setStrategy(copyStrategy);
} else {
if (strategyShouldBeCopiedAndSet == Boolean.FALSE) {
copy.strategy = null;
}
}
}
{
Boolean generatorShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.generator!= null));
if (generatorShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceGenerator;
sourceGenerator = this.getGenerator();
String copyGenerator = ((String) strategy.copy(LocatorUtils.property(locator, "generator", sourceGenerator), sourceGenerator, (this.generator!= null)));
copy.setGenerator(copyGenerator);
} else {
if (generatorShouldBeCopiedAndSet == Boolean.FALSE) {
copy.generator = null;
}
}
}
}
return draftCopy;
}
@Override
public Object createNewInstance() {
return new GeneratedValue();
}
@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 GeneratedValue) {
final GeneratedValue target = this;
final GeneratedValue leftObject = ((GeneratedValue) left);
final GeneratedValue rightObject = ((GeneratedValue) right);
{
Boolean strategyShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.strategy!= null), (rightObject.strategy!= null));
if (strategyShouldBeMergedAndSet == Boolean.TRUE) {
String lhsStrategy;
lhsStrategy = leftObject.getStrategy();
String rhsStrategy;
rhsStrategy = rightObject.getStrategy();
String mergedStrategy = ((String) strategy.merge(LocatorUtils.property(leftLocator, "strategy", lhsStrategy), LocatorUtils.property(rightLocator, "strategy", rhsStrategy), lhsStrategy, rhsStrategy, (leftObject.strategy!= null), (rightObject.strategy!= null)));
target.setStrategy(mergedStrategy);
} else {
if (strategyShouldBeMergedAndSet == Boolean.FALSE) {
target.strategy = null;
}
}
}
{
Boolean generatorShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.generator!= null), (rightObject.generator!= null));
if (generatorShouldBeMergedAndSet == Boolean.TRUE) {
String lhsGenerator;
lhsGenerator = leftObject.getGenerator();
String rhsGenerator;
rhsGenerator = rightObject.getGenerator();
String mergedGenerator = ((String) strategy.merge(LocatorUtils.property(leftLocator, "generator", lhsGenerator), LocatorUtils.property(rightLocator, "generator", rhsGenerator), lhsGenerator, rhsGenerator, (leftObject.generator!= null), (rightObject.generator!= null)));
target.setGenerator(mergedGenerator);
} else {
if (generatorShouldBeMergedAndSet == Boolean.FALSE) {
target.generator = null;
}
}
}
}
}
}