1

I got some problems with a request with Doctrine.

I do a findOneByFieldName on my entity which is supposed to retrieves me an object.

I want to findOneByNameSurname (NameSurname is a string) with a parameter which contains for example 'BEART Jean-Francois'.

What I want is that doctrine retrieves me the user BEART Jean-Francois, if only BEART Jean-Francois exists in the table. Nevertheless, if I give to doctrine 'BEART Jean-francois' with an f lowercase, doctrine still retrieves me the user holding the 'BEART Jean-Francois' field with the F uppercase.

What I want is that doctrine should be sensitive with the whole string, I mean that it should not squizze the duplicate name, even if, for real its not a duplicate name as it is written differently (upper case on the f letter).

I tried to run an SQL request directly in SqlDeveloper to test if Oracle makes the difference with and without the f lower or uppercase in 'Jean-Francois', and it DOES.

So what am I missing ? How can I say to doctrine, if you got an f lowercase in the string parameter I give you, and you only find a F uppercase in DB, please don't retrieve me anything, its not a match ...

Thanks anyway for your help.

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
Umar3x
  • 1,084
  • 10
  • 22
  • create your own repository function - read documentation first: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/working-with-objects.html#custom-repositories – LBA Oct 25 '16 at 10:07
  • 1
    You shouldn't write the tags in your tittle; also see how to make your question clearer. See http://stackoverflow.com/editing-help . – J. Chomel Oct 26 '16 at 09:20

1 Answers1

0

Solved my problems in my oracle Listener ....

I had that :

private static $_SQL_SET_SORT = "ALTER SESSION SET NLS_SORT=Latin_AI";
private static $_SQL_SET_COMP = "ALTER SESSION SET NLS_COMP=LINGUISTIC";

Changed it to that and now doctrine is sensitive :

 private static $_SQL_SET_SORT = "ALTER SESSION SET NLS_SORT=BINARY_CI";
  private static $_SQL_SET_COMP = "ALTER SESSION SET NLS_COMP=BINARY";

See this post for more info :

Case insensitive searching in Oracle

Community
  • 1
  • 1
Umar3x
  • 1,084
  • 10
  • 22