Tabnine Logo
FilterDefinition.getParameterType
Code IndexAdd Tabnine to your IDE (free)

How to use
getParameterType
method
in
org.hibernate.engine.spi.FilterDefinition

Best Java code snippets using org.hibernate.engine.spi.FilterDefinition.getParameterType (Showing top 18 results out of 315)

origin: hibernate/hibernate-orm

public Type getFilterParameterType(String filterParameterName) {
  final String[] parsed = parseFilterParameterName( filterParameterName );
  final FilterDefinition filterDef = sessionFactory.getFilterDefinition( parsed[0] );
  if ( filterDef == null ) {
    throw new IllegalArgumentException( "Filter [" + parsed[0] + "] not defined" );
  }
  final Type type = filterDef.getParameterType( parsed[1] );
  if ( type == null ) {
    // this is an internal error of some sort...
    throw new InternalError( "Unable to locate type for filter parameter" );
  }
  return type;
}
origin: hibernate/hibernate-orm

/**
 * Set the named parameter's value for this filter.
 *
 * @param name The parameter's name.
 * @param value The value to be applied.
 * @return This FilterImpl instance (for method chaining).
 * @throws IllegalArgumentException Indicates that either the parameter was undefined or that the type
 * of the passed value did not match the configured type.
 */
public Filter setParameter(String name, Object value) throws IllegalArgumentException {
  // Make sure this is a defined parameter and check the incoming value type
  // TODO: what should be the actual exception type here?
  Type type = definition.getParameterType( name );
  if ( type == null ) {
    throw new IllegalArgumentException( "Undefined filter parameter [" + name + "]" );
  }
  if ( value != null && !type.getReturnedClass().isAssignableFrom( value.getClass() ) ) {
    throw new IllegalArgumentException( "Incorrect type for parameter [" + name + "]" );
  }
  parameters.put( name, value );
  return this;
}
origin: hibernate/hibernate-orm

/**
 * Set the named parameter's value list for this filter.  Used
 * in conjunction with IN-style filter criteria.
 *
 * @param name   The parameter's name.
 * @param values The values to be expanded into an SQL IN list.
 * @return This FilterImpl instance (for method chaining).
 */
public Filter setParameterList(String name, Collection values) throws HibernateException  {
  // Make sure this is a defined parameter and check the incoming value type
  if ( values == null ) {
    throw new IllegalArgumentException( "Collection must be not null!" );
  }
  Type type = definition.getParameterType( name );
  if ( type == null ) {
    throw new HibernateException( "Undefined filter parameter [" + name + "]" );
  }
  if ( !values.isEmpty() ) {
    Class elementClass = values.iterator().next().getClass();
    if ( !type.getReturnedClass().isAssignableFrom( elementClass ) ) {
      throw new HibernateException( "Incorrect type for parameter [" + name + "]" );
    }
  }
  parameters.put( name, values );
  return this;
}
origin: hibernate/hibernate-orm

final FilterImpl filter = (FilterImpl) filters.get( parts[0] );
final Object value = filter.getParameter( parts[1] );
final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
if ( value != null && Collection.class.isAssignableFrom( value.getClass() ) ) {
  Iterator itr = ( (Collection) value ).iterator();
origin: hibernate/hibernate-orm

final FilterImpl filter = (FilterImpl) walker.getEnabledFilters().get( parts[0] );
final Object value = filter.getParameter( parts[1] );
final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
final String typeBindFragment = String.join(
    ",",
origin: org.hibernate.orm/hibernate-core

public Type getFilterParameterType(String filterParameterName) {
  final String[] parsed = parseFilterParameterName( filterParameterName );
  final FilterDefinition filterDef = sessionFactory.getFilterDefinition( parsed[0] );
  if ( filterDef == null ) {
    throw new IllegalArgumentException( "Filter [" + parsed[0] + "] not defined" );
  }
  final Type type = filterDef.getParameterType( parsed[1] );
  if ( type == null ) {
    // this is an internal error of some sort...
    throw new InternalError( "Unable to locate type for filter parameter" );
  }
  return type;
}
origin: org.hibernate/com.springsource.org.hibernate.core

public Type getFilterParameterType(String filterParameterName) {
  String[] parsed = parseFilterParameterName( filterParameterName );
  FilterDefinition filterDef = sessionFactory.getFilterDefinition( parsed[0] );
  if ( filterDef == null ) {
    throw new IllegalArgumentException( "Filter [" + parsed[0] + "] not defined" );
  }
  Type type = filterDef.getParameterType( parsed[1] );
  if ( type == null ) {
    // this is an internal error of some sort...
    throw new InternalError( "Unable to locate type for filter parameter" );
  }
  return type;
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * Set the named parameter's value for this filter.
 *
 * @param name The parameter's name.
 * @param value The value to be applied.
 * @return This FilterImpl instance (for method chaining).
 * @throws IllegalArgumentException Indicates that either the parameter was undefined or that the type
 * of the passed value did not match the configured type.
 */
public Filter setParameter(String name, Object value) throws IllegalArgumentException {
  // Make sure this is a defined parameter and check the incoming value type
  // TODO: what should be the actual exception type here?
  Type type = definition.getParameterType( name );
  if ( type == null ) {
    throw new IllegalArgumentException( "Undefined filter parameter [" + name + "]" );
  }
  if ( value != null && !type.getReturnedClass().isAssignableFrom( value.getClass() ) ) {
    throw new IllegalArgumentException( "Incorrect type for parameter [" + name + "]" );
  }
  parameters.put( name, value );
  return this;
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * Set the named parameter's value for this filter.
 *
 * @param name The parameter's name.
 * @param value The value to be applied.
 * @return This FilterImpl instance (for method chaining).
 * @throws IllegalArgumentException Indicates that either the parameter was undefined or that the type
 * of the passed value did not match the configured type.
 */
public Filter setParameter(String name, Object value) throws IllegalArgumentException {
  // Make sure this is a defined parameter and check the incoming value type
  // TODO: what should be the actual exception type here?
  Type type = definition.getParameterType( name );
  if ( type == null ) {
    throw new IllegalArgumentException( "Undefined filter parameter [" + name + "]" );
  }
  if ( value != null && !type.getReturnedClass().isAssignableFrom( value.getClass() ) ) {
    throw new IllegalArgumentException( "Incorrect type for parameter [" + name + "]" );
  }
  parameters.put( name, value );
  return this;
}
origin: org.hibernate/com.springsource.org.hibernate

public Type getFilterParameterType(String filterParameterName) {
  String[] parsed = parseFilterParameterName( filterParameterName );
  FilterDefinition filterDef = sessionFactory.getFilterDefinition( parsed[0] );
  if ( filterDef == null ) {
    throw new IllegalArgumentException( "Filter [" + parsed[0] + "] not defined" );
  }
  Type type = filterDef.getParameterType( parsed[1] );
  if ( type == null ) {
    // this is an internal error of some sort...
    throw new InternalError( "Unable to locate type for filter parameter" );
  }
  return type;
}
origin: org.hibernate.orm/hibernate-core

/**
 * Set the named parameter's value for this filter.
 *
 * @param name The parameter's name.
 * @param value The value to be applied.
 * @return This FilterImpl instance (for method chaining).
 * @throws IllegalArgumentException Indicates that either the parameter was undefined or that the type
 * of the passed value did not match the configured type.
 */
@SuppressWarnings("unchecked")
public Filter setParameter(String name, Object value) throws IllegalArgumentException {
  // Make sure this is a defined parameter and check the incoming value type
  // TODO: what should be the actual exception type here?
  Type type = definition.getParameterType( name );
  if ( type == null ) {
    throw new IllegalArgumentException( "Undefined filter parameter [" + name + "]" );
  }
  if ( value != null && !type.getJavaTypeDescriptor().getJavaType().isAssignableFrom( value.getClass() ) ) {
    throw new IllegalArgumentException( "Incorrect type for parameter [" + name + "]" );
  }
  parameters.put( name, value );
  return this;
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * Set the named parameter's value list for this filter.  Used
 * in conjunction with IN-style filter criteria.
 *
 * @param name   The parameter's name.
 * @param values The values to be expanded into an SQL IN list.
 * @return This FilterImpl instance (for method chaining).
 */
public Filter setParameterList(String name, Collection values) throws HibernateException  {
  // Make sure this is a defined parameter and check the incoming value type
  if ( values == null ) {
    throw new IllegalArgumentException( "Collection must be not null!" );
  }
  Type type = definition.getParameterType( name );
  if ( type == null ) {
    throw new HibernateException( "Undefined filter parameter [" + name + "]" );
  }
  if ( values.size() > 0 ) {
    Class elementClass = values.iterator().next().getClass();
    if ( !type.getReturnedClass().isAssignableFrom( elementClass ) ) {
      throw new HibernateException( "Incorrect type for parameter [" + name + "]" );
    }
  }
  parameters.put( name, values );
  return this;
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * Set the named parameter's value list for this filter.  Used
 * in conjunction with IN-style filter criteria.
 *
 * @param name   The parameter's name.
 * @param values The values to be expanded into an SQL IN list.
 * @return This FilterImpl instance (for method chaining).
 */
public Filter setParameterList(String name, Collection values) throws HibernateException  {
  // Make sure this is a defined parameter and check the incoming value type
  if ( values == null ) {
    throw new IllegalArgumentException( "Collection must be not null!" );
  }
  Type type = definition.getParameterType( name );
  if ( type == null ) {
    throw new HibernateException( "Undefined filter parameter [" + name + "]" );
  }
  if ( values.size() > 0 ) {
    Class elementClass = values.iterator().next().getClass();
    if ( !type.getReturnedClass().isAssignableFrom( elementClass ) ) {
      throw new HibernateException( "Incorrect type for parameter [" + name + "]" );
    }
  }
  parameters.put( name, values );
  return this;
}
origin: org.hibernate.orm/hibernate-core

/**
 * Set the named parameter's value list for this filter.  Used
 * in conjunction with IN-style filter criteria.
 *
 * @param name   The parameter's name.
 * @param values The values to be expanded into an SQL IN list.
 * @return This FilterImpl instance (for method chaining).
 */
@SuppressWarnings("unchecked")
public Filter setParameterList(String name, Collection values) throws HibernateException  {
  // Make sure this is a defined parameter and check the incoming value type
  if ( values == null ) {
    throw new IllegalArgumentException( "Collection must be not null!" );
  }
  Type type = definition.getParameterType( name );
  if ( type == null ) {
    throw new HibernateException( "Undefined filter parameter [" + name + "]" );
  }
  if ( !values.isEmpty() ) {
    Class elementClass = values.iterator().next().getClass();
    if ( !type.getJavaTypeDescriptor().getJavaType().isAssignableFrom( elementClass ) ) {
      throw new HibernateException( "Incorrect type for parameter [" + name + "]" );
    }
  }
  parameters.put( name, values );
  return this;
}
origin: org.hibernate/com.springsource.org.hibernate.core

final FilterImpl filter = ( FilterImpl ) filters.get( parts[0] );
final Object value = filter.getParameter( parts[1] );
final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
if ( value != null && Collection.class.isAssignableFrom( value.getClass() ) ) {
  Iterator itr = ( ( Collection ) value ).iterator();
origin: org.hibernate/com.springsource.org.hibernate

final FilterImpl filter = ( FilterImpl ) filters.get( parts[0] );
final Object value = filter.getParameter( parts[1] );
final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
if ( value != null && Collection.class.isAssignableFrom( value.getClass() ) ) {
  Iterator itr = ( ( Collection ) value ).iterator();
origin: org.hibernate/com.springsource.org.hibernate.core

final FilterImpl filter = ( FilterImpl ) walker.getEnabledFilters().get( parts[0] );
final Object value = filter.getParameter( parts[1] );
final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
final String typeBindFragment = StringHelper.join(
    ",",
origin: org.hibernate/com.springsource.org.hibernate

final FilterImpl filter = ( FilterImpl ) walker.getEnabledFilters().get( parts[0] );
final Object value = filter.getParameter( parts[1] );
final Type type = filter.getFilterDefinition().getParameterType( parts[1] );
final String typeBindFragment = StringHelper.join(
    ",",
org.hibernate.engine.spiFilterDefinitiongetParameterType

Javadoc

Retrieve the type of the named parameter defined for this filter.

Popular methods of FilterDefinition

  • <init>
    Construct a new FilterDefinition instance.
  • getDefaultFilterCondition
  • getFilterName
    Get the name of the filter this configuration defines.
  • getParameterNames
    Get a set of the parameters defined by this configuration.
  • getParameterTypes

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • startActivity (Activity)
  • setScale (BigDecimal)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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