Aller au contenu principal

Create a Like filter with a Entity as param

Commentaires

4 commentaires

  • Zendesk API User
    Author: kohlbrecher - 2/4/2013 15:53

    Hi Antonio,

    what you need is a simple value like int or String, not an object like an identifier.

    This could work:

    fillter=new Like("arcticles",(String)article.getValue("name"));

    I don't know your Database but arcticles sounds like a list or an entity. I think you need something more like articles.name or so.

    Here is a complete, working sample for the Mithras Example, I hope this can help you:

    import de.espirit.firstspirit.access.store.IDProvider;

    import de.espirit.firstspirit.access.store.Store;

    import de.espirit.or.query.*;

    import de.espirit.or.*;

    productContent2Name = "products";

    // showInfo

    showInfo(String message) {

              JOptionPane.showMessageDialog(null, message, "Seitentitel", JOptionPane.INFORMATION_MESSAGE);

    }

    contentStore = context.getUserService().getStore(Store.Type.CONTENTSTORE, false);

    productContent2 = contentStore.getContent2ByName(productContent2Name);

    schema = productContent2.getSchema();

    session = schema.getSession();

    select = session.createSelect(productContent2.getEntityType().getName());

    like = new Like("Name_DE", "Accum 1");

    select.setConstraint(like);

    entityList = session.executeQuery(select);

    showInfo(entityList.size()+"");

    Best regards

    Jan

    0
  • Zendesk API User
    Author: zava - 2/4/2013 16:43

    Hi Jan,

    I found the FSs relation column,

    Like filter = new Like("arti_fs_id", article.getValue("fs_id").toString() );

    tx & regards

    Antonio

    0
  • Zendesk API User
    Author: zava - 4/17/2013 14:08

    or like this...

        Like filter = new Like("articles.fs_id", entity.getValue("fs_id").toString() );

    0
  • Zendesk API User
    Author: Peter_Jodeleit - 4/17/2013 14:59

    Should also work without the "toString()" call.

    0

Vous devez vous connecter pour laisser un commentaire.