Best code examples for Hibernate ORM MatchMode class (org.hibernate.criterion.MatchMode)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM MatchMode class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Hibernate ORM MatchMode examples from Open Source projects
This code example shows how to use the following methods: toMatchString
		Query query = sessionFactory.getCurrentSession().createQuery(
		    "from Cohort c where :patientId in elements(c.memberIds) and c.voided = false order by name"); 
		query.setInteger("patientId", patientId);
		return (List<Cohort>) query.list();
	} 
	 
	/** 
	 * @see org.openmrs.api.db.CohortDAO#getCohortByUuid(java.lang.String) 
	 */ 
	public Cohort getCohortByUuid(String uuid) {
		return (Cohort) sessionFactory.getCurrentSession().createQuery("from Cohort c where c.uuid = :uuid").setString(
		    "uuid", uuid).uniqueResult();
	} 
	 
	/** 
	 * @see org.openmrs.api.db.CohortDAO#deleteCohort(org.openmrs.Cohort) 
	 */ 
	public Cohort deleteCohort(Cohort cohort) throws DAOException {
		sessionFactory.getCurrentSession().delete(cohort);
		return null; 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: toMatchString
    public static String escapeWildcard(String value) {
        return value.replaceAll("%", "\\\\%").replaceAll("_", "\\\\_");
    } 
 
    public static String match(String pattern, MatchMode matchMode) {
        return matchMode.toMatchString(pattern);
    } 
 
    public static String gt(String property, String namedParam) {
        return property + ">" + namedParam;
    } 
 
    public static String lt(String property, String namedParam) {
        return property + "<" + namedParam;
    } 
} 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: toMatchString
    public String getSQLTemplate() {
        return " " + getSQLFieldName() + " ILIKE %s "; 
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public String getBoundValue(String value) {
        return '%' + value + '%';
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public String formatValue(String value) {
        return super.formatValue('%'+value+'%');
    } 
     
     
 
} 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: toMatchString
    @Override 
    public Criterion getCriterion() {
        return Restrictions.not(Restrictions.ilike(getPropertyName(), getValue(), MatchMode.ANYWHERE));
    } 
     
    /** {@inheritDoc} */ 
    @Override 
    public String getBoundValue(String value) {
        return '%' + value + '%';
    } 
     
    /** {@inheritDoc} */ 
    @Override 
    public String formatValue(String value) {
        return super.formatValue('%'+value+'%');
    } 
 
 
} 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: toMatchString
 
    /** 
	 * Apply a "like" constraint 
	 */ 
	public AuditCriterion like(String value, MatchMode matchMode) {
		return new SimpleAuditExpression(propertyNameGetter, matchMode.toMatchString(value), " like " );
	} 
 
    /** 
	 * Apply a "greater than" constraint 
	 */ 
	public AuditCriterion gt(T value) {
		return new SimpleAuditExpression(propertyNameGetter, value, ">");
	} 
 
    /** 
	 * Apply a "less than" constraint 
	 */ 
	public AuditCriterion lt(T value) {
		return new SimpleAuditExpression(propertyNameGetter, value, "<");
Full Snippet Info
4
CodeRank