Tabnine Logo
StringType.sqlType
Code IndexAdd Tabnine to your IDE (free)

How to use
sqlType
method
in
org.hibernate.type.StringType

Best Java code snippets using org.hibernate.type.StringType.sqlType (Showing top 15 results out of 315)

origin: hibernate/hibernate-orm

@Override
public int[] sqlTypes() {
  return new int[] {StringType.INSTANCE.sqlType()};
}
origin: hibernate/hibernate-orm

public void nullSafeSet(
    final PreparedStatement st, final Object value,
    final int index, final SharedSessionContractImplementor session)
    throws HibernateException, SQLException {
  if ( value == null ) {
    st.setNull( index, StringType.INSTANCE.sqlType() );
    st.setNull( index + 1, IntegerType.INSTANCE.sqlType() );
  }
  else {
    final Component comp = (Component) value;
    st.setString( index, comp.getProp1() );
    st.setInt( index + 1, comp.getProp2() );
  }
}
origin: Evolveum/midpoint

@Override
public int[] sqlTypes() {
  return new int[]{StringType.INSTANCE.sqlType()};
}
origin: hibernate/hibernate-search

@Override
public int[] sqlTypes() {
  return new int[]{ delegateType.sqlType() };
}
origin: riotfamily/riot

public void nullSafeSet(PreparedStatement st, Object value, int index,
    SessionImplementor session) throws HibernateException, SQLException {
  
  if (value == null) {
    st.setNull(index, StringType.INSTANCE.sqlType());
    st.setNull(index + 1, StringType.INSTANCE.sqlType());
  }
  else {
    st.setString(index, value.getClass().getName());
    st.setString(index + 1, value.toString());
  }
}
origin: bonitasoft/bonita-engine

@Override
public void nullSafeSet(final PreparedStatement st, final Object value, final int index, final SessionImplementor session) throws HibernateException {
  try {
    if (value == null) {
      st.setNull(index, type.sqlType());
    } else {
      final String identifier = (String) identifierMethod.invoke(value, new Object[0]);
      type.set(st, identifier, index, session);
    }
  } catch (final Exception e) {
    final StringBuilder stb = new StringBuilder("Exception while invoking identifierMethod '");
    stb.append(valueOfMethod.getName());
    stb.append("' of enumeration class '");
    stb.append(enumClass);
    stb.append('\'');
    throw new HibernateException(stb.toString(), e);
  }
}
origin: bonitasoft/bonita-engine

@Override
public void nullSafeSet(final PreparedStatement st, final Object value, final int index, final SessionImplementor session) throws HibernateException {
  try {
    if (value == null) {
      st.setNull(index, type.sqlType());
    } else {
      final String identifier = (String) identifierMethod.invoke(value, new Object[0]);
      type.set(st, identifier, index, session);
    }
  } catch (final Exception e) {
    final StringBuilder stb = new StringBuilder("Exception while invoking identifierMethod '");
    stb.append(valueOfMethod.getName());
    stb.append("' of enumeration class '");
    stb.append(enumClass);
    stb.append('\'');
    throw new HibernateException(stb.toString(), e);
  }
}
origin: bonitasoft/bonita-engine

@Override
public void setParameterValues(final Properties parameters) {
  final String enumClassName = parameters.getProperty("enumClass");
  try {
    enumClass = Class.forName(enumClassName).asSubclass(Enum.class);
  } catch (final ClassNotFoundException cfne) {
    final String message = "Enum class not found";
    throw new HibernateException(message, cfne);
  }
  final String identifierMethodName = parameters.getProperty("identifierMethod", DEFAULT_IDENTIFIER_METHOD_NAME);
  try {
    identifierMethod = enumClass.getMethod(identifierMethodName, new Class[0]);
    identifierType = identifierMethod.getReturnType();
  } catch (final Exception e) {
    final String message = "Failed to obtain identifier method";
    throw new HibernateException(message, e);
  }
  sqlTypes = new int[] { type.sqlType() };
  final String valueOfMethodName = parameters.getProperty("valueOfMethod", DEFAULT_VALUE_OF_METHOD_NAME);
  try {
    valueOfMethod = enumClass.getMethod(valueOfMethodName, new Class[] { identifierType });
  } catch (final Exception e) {
    final String message = "Failed to obtain valueOf method";
    throw new HibernateException(message, e);
  }
}
origin: org.openwms/org.openwms.common.service

/**
 * {@inheritDoc}
 */
@Override
public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException {
  if (value == null) {
    st.setNull(index, StandardBasicTypes.STRING.sqlType());
    st.setNull(index + 1, StandardBasicTypes.BIG_DECIMAL.sqlType());
  } else {
    Piece piece = (Piece) value;
    String unitType = piece.getUnitType().toString();
    st.setString(index, unitType);
    st.setBigDecimal(index + 1, piece.getMagnitude());
  }
}
origin: bonitasoft/bonita-engine

@Override
public void setParameterValues(final Properties parameters) {
  final String enumClassName = parameters.getProperty("enumClass");
  try {
    enumClass = Class.forName(enumClassName).asSubclass(Enum.class);
  } catch (final ClassNotFoundException cfne) {
    final String message = "Enum class not found";
    throw new HibernateException(message, cfne);
  }
  final String identifierMethodName = parameters.getProperty("identifierMethod", DEFAULT_IDENTIFIER_METHOD_NAME);
  try {
    identifierMethod = enumClass.getMethod(identifierMethodName, new Class[0]);
    identifierType = identifierMethod.getReturnType();
  } catch (final Exception e) {
    final String message = "Failed to obtain identifier method";
    throw new HibernateException(message, e);
  }
  sqlTypes = new int[] { type.sqlType() };
  final String valueOfMethodName = parameters.getProperty("valueOfMethod", DEFAULT_VALUE_OF_METHOD_NAME);
  try {
    valueOfMethod = enumClass.getMethod(valueOfMethodName, new Class[] { identifierType });
  } catch (final Exception e) {
    final String message = "Failed to obtain valueOf method";
    throw new HibernateException(message, e);
  }
}
origin: org.openwms/org.openwms.common.domain

/**
 * {@inheritDoc}
 * 
 * @throws SQLException
 *             in case of database errors
 */
@Override
public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session)
    throws SQLException {
  if (value == null) {
    st.setNull(index, StandardBasicTypes.STRING.sqlType());
    st.setNull(index + 1, StandardBasicTypes.BIG_DECIMAL.sqlType());
  } else {
    Piece piece = (Piece) value;
    String unitType = piece.getUnitType().toString();
    st.setString(index, unitType);
    st.setBigDecimal(index + 1, piece.getMagnitude());
  }
}
origin: org.ow2.bonita/bonita-server

@Override
public void nullSafeSet(final PreparedStatement st, final Object value, final int index) throws SQLException {
 try {
  if (value == null) {
   st.setNull(index, type.sqlType());
  } else {
   final String identifier = (String) identifierMethod.invoke(value, new Object[0]);
   type.set(st, identifier, index);
  }
 } catch (final Exception e) {
  final String message = ExceptionManager.getInstance().getFullMessage("bh_GEUT_6", identifierMethod.getName(),
    enumClass);
  throw new HibernateException(message, e);
 }
}
origin: org.openwms/org.openwms.common.service

public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException {
  if (value == null) {
    st.setNull(index, StandardBasicTypes.STRING.sqlType());
    st.setNull(index + 1, StandardBasicTypes.STRING.sqlType());
  } else {
    if (value instanceof Piece) {
origin: org.openwms/org.openwms.common.domain

  throws SQLException {
if (value == null) {
  st.setNull(index, StandardBasicTypes.STRING.sqlType());
  st.setNull(index + 1, StandardBasicTypes.STRING.sqlType());
} else {
  if (value instanceof Piece) {
origin: org.ow2.bonita/bonita-server

@Override
public void setParameterValues(final Properties parameters) {
 final String enumClassName = parameters.getProperty("enumClass");
 try {
  enumClass = Class.forName(enumClassName).asSubclass(Enum.class);
 } catch (final ClassNotFoundException cfne) {
  final String message = ExceptionManager.getInstance().getFullMessage("bh_GEUT_1");
  throw new HibernateException(message, cfne);
 }
 final String identifierMethodName = parameters.getProperty("identifierMethod", DEFAULT_IDENTIFIER_METHOD_NAME);
 Class<?> identifierType;
 try {
  identifierMethod = enumClass.getMethod(identifierMethodName, new Class[0]);
  identifierType = identifierMethod.getReturnType();
 } catch (final Exception e) {
  final String message = ExceptionManager.getInstance().getFullMessage("bh_GEUT_2");
  throw new HibernateException(message, e);
 }
 sqlTypes = new int[] { type.sqlType() };
 final String valueOfMethodName = parameters.getProperty("valueOfMethod", DEFAULT_VALUE_OF_METHOD_NAME);
 try {
  valueOfMethod = enumClass.getMethod(valueOfMethodName, new Class[] { identifierType });
 } catch (final Exception e) {
  final String message = ExceptionManager.getInstance().getFullMessage("bh_GEUT_4");
  throw new HibernateException(message, e);
 }
}
org.hibernate.typeStringTypesqlType

Popular methods of StringType

  • nullSafeGet
  • nullSafeSet
  • getName
  • <init>
  • objectToSQLString
  • set
  • get
  • getJavaTypeDescriptor
  • getSqlTypeDescriptor
  • stringToObject
  • toString
  • toString

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
  • String (java.lang)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JOptionPane (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now