All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tools.xor.view.UnmodifiableBindParameter Maven / Gradle / Ivy

There is a newer version: 2.4.1
Show newest version
package tools.xor.view;

import java.sql.PreparedStatement;

import javax.persistence.ParameterMode;

import tools.xor.providers.jdbc.DBTranslator;

public class UnmodifiableBindParameter extends BindParameter
{

    private final BindParameter paramMap;

    public UnmodifiableBindParameter (BindParameter paramMap)
    {
        this.paramMap = paramMap;
    }

    private void raiseException ()
    {
        throw new UnsupportedOperationException(
            "Changes are not allowed on the ParameterMapping, make a copy of the view to make necessary changes.");
    }

    @Override public void setName (String name)
    {
        raiseException();
    }

    @Override public void setAttribute (String attribute)
    {
        raiseException();
    }

    @Override public void setType (String type)
    {
        raiseException();
    }

    @Override public void setDefaultValue (String defaultValue)
    {
        raiseException();
    }

    @Override public void setMode (ParameterMode mode)
    {
        raiseException();
    }

    @Override public boolean isReturnType ()
    {
        return paramMap.isReturnType();
    }

    @Override public void setReturnType (boolean value)
    {
        raiseException();
    }

    @Override public void setValue (PreparedStatement cs, DBTranslator translator, Object value)
    {
        raiseException();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy