Announcement Announcement Module
Collapse
No announcement yet.
Native Query with equalsIgnoreCase Error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Native Query with equalsIgnoreCase Error

    Assalamu'alaikum.

    I use db4o 7.4 version, and this is my code:

    List katas = new ArrayList();
    try {
    container = Db4oConnection.getInstance().getObjectContainer();
    katas = container.query(new Predicate() {
    @Override
    public boolean match(Kata kata) {
    return kata.getKata().equalsIgnoreCase(string);
    }
    });
    } catch (Exception e) {
    JOptionPane.showMessageDialog(null, e);
    }
    if (katas.isEmpty() || katas == null) {
    return string;
    } else {
    return katas.get(0).getMakna();
    }

    The error message is:


    init:
    deps-jar:
    compile:
    run:
    Exception in thread "db4o server message dispatcher mudzakkir" java.lang.IllegalArgumentException: array element type mismatch
    at java.lang.reflect.Array.set(Native Method)
    at com.db4o.reflect.core.AbstractReflectArray.set(Abs tractReflectArray.java:101)
    at com.db4o.reflect.generic.GenericArrayReflector.set (GenericArrayReflector.java:85)
    at com.db4o.internal.handlers.array.ArrayHandler.read Into(ArrayHandler.java:400)
    at com.db4o.internal.handlers.array.ArrayHandler.read Elements(ArrayHandler.java:377)
    at

    Look at this native Query Code:

    container = Db4oConnection.getInstance().getObjectContainer();
    katas = container.query(new Predicate() {
    @Override
    public boolean match(Kata kata) {
    return kata.getKata().equalsIgnoreCase(string);
    }
    });

    If I change the parameter like this:

    return kata.getKata().equals(string);

    The application not error, work fine.

    But, i want the parameter in query is not case sensitive, so I input the parameter like that.

    Any clue error please?...

    __

    Mudzakkir

    http://teknologiinformasi1.blogspot.com/
Working...
X