Examples of enableLike()


Examples of org.hibernate.criterion.Example.enableLike()

  }

  public static Example getExampleCriterion(Object entity, String[] excludePropertes, MatchMode mode) {
    Example example = Example.create(entity).setPropertySelector(new NotEmptyPropertySelector());
    if (null != mode) {
      example.enableLike(mode);
    }
    if (null != excludePropertes) {
      for (int i = 0; i < excludePropertes.length; i++) {
        example.excludeProperty(excludePropertes[i]);
      }
View Full Code Here

Examples of org.hibernate.criterion.Example.enableLike()

     * @see no.ugland.utransprod.dao.DAO#findByExampleLike(java.lang.Object)
     */
    @SuppressWarnings("unchecked")
    public final List<E> findByExampleLike(final E example) {
        Example exam = Example.create(example);
        exam.enableLike(MatchMode.ANYWHERE); // this is it.
        exam.ignoreCase();
        DetachedCriteria detachedCriteria = DetachedCriteria.forClass(clazz).add(exam);
       
        detachedCriteria = getCriteria(example, detachedCriteria);

View Full Code Here

Examples of org.hibernate.criterion.Example.enableLike()

        return getHibernateTemplate().findByCriteria(detachedCriteria);
    }

    private DetachedCriteria getCriteria(final Object example, DetachedCriteria detachedCriteria) {
        Example exam = Example.create(example);
        exam.enableLike(MatchMode.ANYWHERE); // this is it.
        exam.ignoreCase();
       
       

View Full Code Here

Examples of org.hibernate.criterion.Example.enableLike()

    return (List<Order>) getHibernateTemplate().execute(
        new HibernateCallback() {

          public Object doInHibernate(final Session session) {
            Example example = Example.create(order);
            example.enableLike(MatchMode.ANYWHERE);
            example.ignoreCase();
            example.excludeZeroes();

            Criteria crit = session.createCriteria(Order.class)
                .add(example);
View Full Code Here

Examples of org.hibernate.criterion.Example.enableLike()

  public static Example getExampleCriterion(Object entity, String[] excludePropertes,
      MatchMode mode) {
    Example example = Example.create(entity)
        .setPropertySelector(new NotEmptyPropertySelector());
    if (null != mode) {
      example.enableLike(mode);
    }
    if (null != excludePropertes) {
      for (int i = 0; i < excludePropertes.length; i++) {
        example.excludeProperty(excludePropertes[i]);
      }
View Full Code Here

Examples of org.hibernate.criterion.Example.enableLike()

  }

  public static Example getExampleCriterion(Object entity, String[] excludePropertes, MatchMode mode) {
    Example example = Example.create(entity).setPropertySelector(new NotEmptyPropertySelector());
    if (null != mode) {
      example.enableLike(mode);
    }
    if (null != excludePropertes) {
      for (int i = 0; i < excludePropertes.length; i++) {
        example.excludeProperty(excludePropertes[i]);
      }
View Full Code Here

Examples of org.hibernate.criterion.Example.enableLike()

    Example example = Example.create(exampleEntity).ignoreCase().excludeZeroes();
   
    if (exampleEntity.getName() == null){
       found = session
      .createCriteria(exampleEntity.getClass())
      .add(example.enableLike(MatchMode.START).excludeProperty("name")).list();
   
     
    }
    if (exampleEntity.getSurname() == null){
       found = session
View Full Code Here

Examples of org.hibernate.criterion.Example.enableLike()

     
    }
    if (exampleEntity.getSurname() == null){
       found = session
        .createCriteria(exampleEntity.getClass())
        .add(example.enableLike(MatchMode.START).excludeProperty("surname")).list();
    }
    else {
       found = session
        .createCriteria(exampleEntity.getClass())
        .add(example.enableLike(MatchMode.START)).list();
View Full Code Here

Examples of org.hibernate.criterion.Example.enableLike()

        .add(example.enableLike(MatchMode.START).excludeProperty("surname")).list();
    }
    else {
       found = session
        .createCriteria(exampleEntity.getClass())
        .add(example.enableLike(MatchMode.START)).list();
    }
   
    return found;
   
   
View Full Code Here

Examples of org.hibernate.criterion.Example.enableLike()

     */
    @Override
    public <T extends Entity, E extends T> List<T> findByExample(final E example, final ExampleSettings<T> settings) {
        Example theExample = Example.create(example);
        if (settings.isLikeEnabled()) {
            theExample.enableLike(MatchMode.ANYWHERE);
        }
        if (settings.isIgnoreCaseEnabled()) {
            theExample.ignoreCase();
        }
        if (settings.isExcludeNone()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.