package org.hibernate.mapping;
import org.hibernate.MappingException;
import org.hibernate.boot.spi.MetadataBuildingContext;
import org.hibernate.boot.spi.MetadataImplementor;
import org.hibernate.type.Type;
public class DependantValue extends SimpleValue {
private KeyValue wrappedValue;
private boolean nullable;
private boolean updateable;
@Deprecated
public DependantValue(MetadataImplementor metadata, Table table, KeyValue prototype) {
super( metadata, table );
this.wrappedValue = prototype;
}
public DependantValue(MetadataBuildingContext buildingContext, Table table, KeyValue prototype) {
super( buildingContext, table );
this.wrappedValue = prototype;
}
public Type getType() throws MappingException {
return wrappedValue.getType();
}
public void setTypeUsingReflection(String className, String propertyName) {}
public Object accept(ValueVisitor visitor) {
return visitor.accept(this);
}
public boolean isNullable() {
return nullable;
}
public void setNullable(boolean nullable) {
this.nullable = nullable;
}
public boolean isUpdateable() {
return updateable;
}
public void setUpdateable(boolean updateable) {
this.updateable = updateable;
}
@Override
public boolean isSame(SimpleValue other) {
return other instanceof DependantValue && isSame( (DependantValue) other );
}
public boolean isSame(DependantValue other) {
return super.isSame( other )
&& isSame( wrappedValue, other.wrappedValue );
}
}