system.data.sqlclient.SqlParameter Maven / Gradle / Ivy
/*
* MIT License
*
* Copyright (c) 2024 MASES s.r.l.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**************************************************************************************
*
* This code was generated from a template using JCOReflector v. 1.14.0.0
*
* Manual changes to this file may cause unexpected behavior in your application.
* Manual changes to this file will be overwritten if the code is regenerated.
*
*************************************************************************************/
package system.data.sqlclient;
import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;
// Import section
import system.data.common.DbParameter;
import system.data.SqlDbType;
import system.data.ParameterDirection;
import system.data.DataRowVersion;
import system.data.DbType;
import system.data.sqltypes.SqlCompareOptions;
import system.ICloneable;
import system.ICloneableImplementation;
/**
* The base .NET class managing System.Data.SqlClient.SqlParameter, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
*
*
* .NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.Data.SqlClient.SqlParameter
*
*
* Powered by JCOBridge: more info at https://www.jcobridge.com
*
* @author MASES s.r.l https://masesgroup.com
* @version 1.14.0.0
*/
public class SqlParameter extends DbParameter implements system.ICloneable {
/**
* Fully assembly qualified name: System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
*/
public static final String assemblyFullName = "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
/**
* Assembly name: System.Data
*/
public static final String assemblyShortName = "System.Data";
/**
* Qualified class name: System.Data.SqlClient.SqlParameter
*/
public static final String className = "System.Data.SqlClient.SqlParameter";
static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName);
/**
* The type managed from JCOBridge. See {@link JCType}
*/
public static JCType classType = createType();
static JCEnum enumInstance = null;
JCObject classInstance = null;
static JCType createType() {
try {
String classToCreate = className + ", "
+ (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Creating %s", classToCreate);
JCType typeCreated = bridge.GetType(classToCreate);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Created: %s",
(typeCreated != null) ? typeCreated.toString() : "Returned null value");
return typeCreated;
} catch (JCException e) {
JCOReflector.writeLog(e);
return null;
}
}
void addReference(String ref) throws Throwable {
try {
bridge.AddReference(ref);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
/**
* Internal constructor. Use with caution
*/
public SqlParameter(java.lang.Object instance) throws Throwable {
super(instance);
if (instance instanceof JCObject) {
classInstance = (JCObject) instance;
} else
throw new Exception("Cannot manage object, it is not a JCObject");
}
public String getJCOAssemblyName() {
return assemblyFullName;
}
public String getJCOClassName() {
return className;
}
public String getJCOObjectName() {
return className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
}
public java.lang.Object getJCOInstance() {
return classInstance;
}
public void setJCOInstance(JCObject instance) {
classInstance = instance;
super.setJCOInstance(classInstance);
}
public JCType getJCOType() {
return classType;
}
/**
* Try to cast the {@link IJCOBridgeReflected} instance into {@link SqlParameter}, a cast assert is made to check if types are compatible.
* @param from {@link IJCOBridgeReflected} instance to be casted
* @return {@link SqlParameter} instance
* @throws java.lang.Throwable in case of error during cast operation
*/
public static SqlParameter cast(IJCOBridgeReflected from) throws Throwable {
NetType.AssertCast(classType, from);
return new SqlParameter(from.getJCOInstance());
}
// Constructors section
public SqlParameter() throws Throwable {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SqlParameter(java.lang.String parameterName, SqlDbType dbType) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.NotImplementedException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.FormatException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(parameterName, dbType == null ? null : dbType.getJCOInstance()));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SqlParameter(java.lang.String parameterName, SqlDbType dbType, int size) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.NotImplementedException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.FormatException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(parameterName, dbType == null ? null : dbType.getJCOInstance(), size));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SqlParameter(java.lang.String parameterName, SqlDbType dbType, int size, ParameterDirection direction, boolean isNullable, byte precision, byte scale, java.lang.String sourceColumn, DataRowVersion sourceVersion, NetObject value) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.NotImplementedException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.FormatException, system.data.sqltypes.SqlNullValueException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(parameterName, dbType == null ? null : dbType.getJCOInstance(), size, direction == null ? null : direction.getJCOInstance(), isNullable, precision, scale, sourceColumn, sourceVersion == null ? null : sourceVersion.getJCOInstance(), value == null ? null : value.getJCOInstance()));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SqlParameter(java.lang.String parameterName, SqlDbType dbType, int size, ParameterDirection direction, byte precision, byte scale, java.lang.String sourceColumn, DataRowVersion sourceVersion, boolean sourceColumnNullMapping, NetObject value, java.lang.String xmlSchemaCollectionDatabase, java.lang.String xmlSchemaCollectionOwningSchema, java.lang.String xmlSchemaCollectionName) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.NotImplementedException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.FormatException, system.data.sqltypes.SqlNullValueException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(parameterName, dbType == null ? null : dbType.getJCOInstance(), size, direction == null ? null : direction.getJCOInstance(), precision, scale, sourceColumn, sourceVersion == null ? null : sourceVersion.getJCOInstance(), sourceColumnNullMapping, value == null ? null : value.getJCOInstance(), xmlSchemaCollectionDatabase, xmlSchemaCollectionOwningSchema, xmlSchemaCollectionName));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SqlParameter(java.lang.String parameterName, SqlDbType dbType, int size, java.lang.String sourceColumn) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.NotImplementedException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.FormatException {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(parameterName, dbType == null ? null : dbType.getJCOInstance(), size, sourceColumn));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SqlParameter(java.lang.String parameterName, NetObject value) throws Throwable {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(parameterName, value == null ? null : value.getJCOInstance()));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Methods section
public void ResetDbType() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("ResetDbType");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void ResetSqlDbType() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("ResetSqlDbType");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
/**
* @deprecated Not for public use because the method is implemented in .NET with an explicit interface.
* Use the static ToICloneable method available in ICloneable to obtain an object with an invocable method
*/
@Deprecated
public NetObject Clone() throws Throwable {
throw new UnsupportedOperationException("Not for public use because the method is implemented with an explicit interface. Use ToICloneable to obtain the full interface.");
}
// Properties section
public boolean getForceColumnEncryption() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Get("ForceColumnEncryption");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setForceColumnEncryption(boolean ForceColumnEncryption) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("ForceColumnEncryption", ForceColumnEncryption);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public byte getPrecision() throws Throwable, system.ArgumentNullException, system.resources.MissingManifestResourceException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.ArgumentException, system.data.sqltypes.SqlNullValueException, system.OverflowException, system.data.sqltypes.SqlTypeException, system.xml.XmlException, system.NotSupportedException, system.reflection.TargetInvocationException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (byte)classInstance.Get("Precision");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setPrecision(byte Precision) throws Throwable, system.ArgumentNullException, system.resources.MissingManifestResourceException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.ArgumentException, system.data.sqltypes.SqlNullValueException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("Precision", Precision);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public byte getScale() throws Throwable, system.ArgumentNullException, system.resources.MissingManifestResourceException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.ArgumentException, system.data.sqltypes.SqlNullValueException, system.OverflowException, system.data.sqltypes.SqlTypeException, system.xml.XmlException, system.NotSupportedException, system.reflection.TargetInvocationException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (byte)classInstance.Get("Scale");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setScale(byte Scale) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("Scale", Scale);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public int getLocaleId() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (int)classInstance.Get("LocaleId");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setLocaleId(int LocaleId) throws Throwable, system.ArgumentOutOfRangeException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("LocaleId", LocaleId);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public int getOffset() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (int)classInstance.Get("Offset");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setOffset(int Offset) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.ArgumentOutOfRangeException, system.NotImplementedException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.threading.AbandonedMutexException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("Offset", Offset);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SqlDbType getSqlDbType() throws Throwable, system.ArgumentNullException, system.ArgumentException, system.resources.MissingManifestResourceException, system.NotImplementedException, system.ObjectDisposedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.data.sqltypes.SqlNullValueException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject val = (JCObject)classInstance.Get("SqlDbType");
return new SqlDbType(val);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setSqlDbType(SqlDbType SqlDbType) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.NotImplementedException, system.globalization.CultureNotFoundException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("SqlDbType", SqlDbType == null ? null : SqlDbType.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public SqlCompareOptions getCompareInfo() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject val = (JCObject)classInstance.Get("CompareInfo");
return new SqlCompareOptions(val);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setCompareInfo(SqlCompareOptions CompareInfo) throws Throwable, system.ArgumentOutOfRangeException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("CompareInfo", CompareInfo == null ? null : CompareInfo.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public NetObject getSqlValue() throws Throwable, system.ArgumentNullException, system.ArgumentException, system.resources.MissingManifestResourceException, system.NotImplementedException, system.ObjectDisposedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.data.sqltypes.SqlNullValueException, system.OverflowException, system.data.sqltypes.SqlTypeException, system.xml.XmlException, system.NotSupportedException, system.reflection.TargetInvocationException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject val = (JCObject)classInstance.Get("SqlValue");
return new NetObject(val);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setSqlValue(NetObject SqlValue) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("SqlValue", SqlValue == null ? null : SqlValue.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String getTypeName() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("TypeName");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setTypeName(java.lang.String TypeName) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("TypeName", TypeName);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String getUdtTypeName() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("UdtTypeName");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setUdtTypeName(java.lang.String UdtTypeName) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("UdtTypeName", UdtTypeName);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String getXmlSchemaCollectionDatabase() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("XmlSchemaCollectionDatabase");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setXmlSchemaCollectionDatabase(java.lang.String XmlSchemaCollectionDatabase) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("XmlSchemaCollectionDatabase", XmlSchemaCollectionDatabase);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String getXmlSchemaCollectionName() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("XmlSchemaCollectionName");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setXmlSchemaCollectionName(java.lang.String XmlSchemaCollectionName) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("XmlSchemaCollectionName", XmlSchemaCollectionName);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public java.lang.String getXmlSchemaCollectionOwningSchema() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("XmlSchemaCollectionOwningSchema");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void setXmlSchemaCollectionOwningSchema(java.lang.String XmlSchemaCollectionOwningSchema) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Set("XmlSchemaCollectionOwningSchema", XmlSchemaCollectionOwningSchema);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Instance Events section
}