Hibernate ORM MatchMode - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM MatchMode class.

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; 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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;
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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+'%');
    } 
     
     
 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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+'%');
    } 
 
 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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, "<");
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:toMatchString
		return (HL7Template) sessionFactory.getCurrentSession().createCriteria(HL7Template.class)
		        .add(Restrictions.eq("name", name)).uniqueResult();
	} 
	 
	@Override 
	public List<HL7Template> getHL7TemplatesByName(String name) {
		@SuppressWarnings("unchecked") 
		List<HL7Template> list = sessionFactory.getCurrentSession().createCriteria(HL7Template.class)
		        .add(Restrictions.ilike("name", name, MatchMode.ANYWHERE)).addOrder(Order.asc("Hl7TemplateId")).list();
		return list;
	} 
	 
	@Override 
	public List<HL7Template> getHL7TemplatesByEntity(String entity) {
		@SuppressWarnings("unchecked") 
		List<HL7Template> list = sessionFactory.getCurrentSession().createCriteria(HL7Template.class)
		        .add(Restrictions.eq("Hl7Entity", entity)).addOrder(Order.asc("Hl7TemplateId")).list();
		return list;
	} 
	 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:toMatchString
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:toMatchString
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Hibernate ORM MatchMode Methods: