javajiraactive-objects

How to write Update query in activeobject entity


How can we write update entity ActiveObject - com.atlassian.activeobjects.external.ActiveObjects.

Any one please share me the stuff.

I am using create entity activeobject stuff as below and it works fine:

    en pi = ao.executeInTransaction(new TransactionCallback() // (1)            
        {   
             @Override
             public en doInTransaction()
             {
                logger.info("before ao.create");
                en pi = ao.create(enclass);
                                    ....

                pi.save();                              
                return pi;          
             }
        });

Thanks


Solution

  • Select the id, set your data in the testAO and finaly save it.

                public Object doInTransaction(){
                    TestAO testAO = ao.get(TestAO.class,issueXXX.getId());
                    testAO.setError(issueXXX.getError());
                    testAO.save();
                    return null;
                }
    

    You can update only one by one, this is the easy way.