Results 1 to 2 of 2

Thread: Case Sensitive Finders

  1. #1

    Exclamation 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.
    ahmet alp balkan.

  2. #2

    Default

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •