Announcement Announcement Module
Collapse
No announcement yet.
Case Sensitive Finders Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Case Sensitive Finders

    Hi there guys,

    When I list finders of an object (here I call "Short") using command
    Code:
    finder list --class com.turkcellteknoloji.kisalt.domain.Short
    I see something like that:
    Code:
    ...
    findShortsByHash(String hash)                                             
    findShortsByHashEquals(String hash) 
    ...
    I thought that those two differ from each one with case-sensitivity. The finders that those two do generate are below:

    Code:
    @SuppressWarnings("unchecked")
        public static Query Short.findShortsByHash(String hash) {
            if (hash == null || hash.length() == 0) throw new IllegalArgumentException("The hash argument is required");
            EntityManager em = Short.entityManager();
            Query q = em.createQuery("SELECT Short FROM Short AS short WHERE short.hash = :hash");
            q.setParameter("hash", hash);
            return q;
        }
        
        @SuppressWarnings("unchecked")
        public static Query Short.findShortsByHashEquals(String hash) {
            if (hash == null || hash.length() == 0) throw new IllegalArgumentException("The hash argument is required");
            EntityManager em = Short.entityManager();
            Query q = em.createQuery("SELECT Short FROM Short AS short WHERE short.hash = :hash");
            q.setParameter("hash", hash);
            return q;
        }
    are completely equal as far I see.

    What is the way to create case-sensitive finders? Why "finder" functionality has those two duplicate things?

    I need reply ASAP.
    Regards.

  • #2
    Actually I still do not see any differences but solved by changing MySQL column collation from utf8_general_ci (case-insensitive) to utf8_bin.

    Comment

    Working...
    X