About like

manual

Strings in JPQL and Criteria Queries

Explains string expressions in JPQL queries, including LIKE, LOCATE, LOWER, UPPER, TRIM, CONCAT and SUBSTRING.... This page covers the following topics: LIKE - String Pattern Matching with Wildcards LENGTH - Counting ... Criteria Query String Expressions LIKE - String Pattern Matching with Wildcards The [NOT] LIKE operator ...

 
issue

Issue with UPPER ?

Hi, Assuming those queries which are all the same except the UPPER calls: ... NOT NULL ) AND ( $4 . name LIKE '%81%' ) ) OR ( ( $5 IS NOT ... NULL ) AND ( $5 . postalCode LIKE '%81%' ) ) OR ( ( $5 IS NOT ...

 
forum_thread

Help: After upgrading from 2.2.8_02 to 2.2.8_04, can't perform LIKE query

Hi,   During the upgrade from 2.2.8_02 (not sure if it was build 03/04 as I skipped 03) - my LIKE queries have stopped working. As an example output: ... (not sure if it was build 03/04 as I skipped 03) - my LIKE queries have stopped working during a regression test. As an example ... Query: SELECT $1 FROM Company $1 WHERE ((($1.companyId LIKE :p1) AND ($1.conditionOne=true)) AND ((($1.conditionTwo=false) OR ...

 
api-jpa

like(x, pattern)

Create a predicate for testing whether the expression satisfies the given pattern.(Method of javax.persistence.criteria.CriteriaBuilder)

 
api-jpa

like(x, pattern)

Create a predicate for testing whether the expression satisfies the given pattern.(Method of javax.persistence.criteria.CriteriaBuilder)

 
forum_thread

Search with wildcards and index issue

Hi, I have a search using wildcards: SELECT $1 FROM CDI $1 WHERE $1.loginId LIKE '%*_last%2' ESCAPE '*' This works perfectly when loginId has NO annotations. Now if I add to loginId the following annotations: @Index(unique="true") @Column(nullable=false,unique=true) the search no longer works. I have attached the unit test. (this is using 2.3.7_10) Thanks Paul. ... using wildcards: SELECT $1 FROM CDI $1 WHERE $1.loginId LIKE '%*_last%2' ESCAPE '*' This works perfectly when ... Your test demonstrates that ESCAPE in LIKE was ignored when using an index. Build 2.3.7_11 fixes this bug. ...

 
forum_thread

Query problem after transaction commit

I have a machine running the objectdb server and the client on another machine connect to it. The client program can connect to the server and query to get all the records. However, after transaction.begin ... persist(p) .. commit of a new object, my client program can no longer retrieve the old records but only the latest stored record. I tried to run database explorer on the server machine and able to see all the records including the new stored record.... 04> SELECT u FROM Goods u where u._code like :code AND u._desc like :desc  05> code= %, desc= % 06> UI: end query ...

 
issue

Different behavior for two equal queries

Hi, I've got two equal queries though they behave differently: SELECT FROM com.quasado.foundation.communication.contact.individual.IndividualContact $1 WHERE (($1.organisation.name LIKE '%Q%')) This correctly returns one entry from my database ... WHERE ( ( $1 . organisation . name LIKE '%Q%' ) ) This correctly returns one entry ... WHERE ( ( $1 . organisation . name LIKE '%Q%' ) OR ( $1 . communication . ...

 
forum_thread

like operator (String)

My application is ready to support different JPA implementation - also ObjectDB. But the automated tests show one little difference. Following search statment will be created by one test case: select i from User i where i.status = :status and (UPPER(i.email) like :value) Now we assume that there is a user with following email 'test@mycompany.com' With :value  = "test" ObjectDB will find the example user. The like statment operates like "test%"  ... i from User i where i.status = :status and (UPPER(i.email) like :value) Now we assume that there is a user with following email ... = "test" ObjectDB will find the example user. The like statment operates like "test%"  EclispeLink/OpenJPA/HibernateJPA handles the like ...

 
forum_thread

Help with 'not like/lower' query

Hi again,   Honestly, I'm fairly new with JPA2 Criteria queries - but as far as code effort goes, it has saved me a bit of pain. I'm writing a dynamic query builder (only 1 level deep for basic entities) - but  even though I get most queries to work, I am getting the following error. This is using Criteria with a combination of LOWER/UPPER - NOT LIKE: ... is using Criteria with a combination of LOWER/UPPER - NOT LIKE: SELECT COUNT ( $1 . id ) FROM User $1 ... AND LOWER ( $1 . email ) NOT LIKE :p2 So in essence, I'm trying to do a count (with a ...