
org.dellroad.querystream.jpa.TemporalParamBinding Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of querystream-jpa Show documentation
Show all versions of querystream-jpa Show documentation
Build JPA Criteria queries using a Stream-like API
The newest version!
/*
* Copyright (C) 2018 Archie L. Cobbs. All rights reserved.
*/
package org.dellroad.querystream.jpa;
import jakarta.persistence.Parameter;
import jakarta.persistence.TemporalType;
abstract class TemporalParamBinding extends ParamBinding {
private final TemporalType temporalType;
TemporalParamBinding(final Parameter parameter, final T value, final TemporalType temporalType) {
super(parameter, value);
if (temporalType == null)
throw new IllegalArgumentException("null temporalType");
this.temporalType = temporalType;
}
/**
* Get the {@link TemporalType}.
*
* @return temporal type to use when binding parameter value
*/
public TemporalType getTemporalType() {
return this.temporalType;
}
// Object
@Override
public boolean equals(Object obj) {
if (!super.equals(obj))
return false;
final TemporalParamBinding> that = (TemporalParamBinding>)obj;
return this.temporalType.equals(that.temporalType);
}
@Override
public int hashCode() {
return super.hashCode() ^ this.temporalType.hashCode();
}
@Override
public String toString() {
return this.getClass().getSimpleName()
+ "[parameter=" + ParamBinding.describeParameter(this.getParameter())
+ ",value=" + this.getValue()
+ ",type=" + this.getTemporalType()
+ "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy