Search in sources :

Example 21 with Transaction

use of com.ramussoft.common.persistent.Transaction in project ramus by Vitaliy-Yakovchuk.

the class IEngineImpl method getAttributeWhatWillBeDeleted.

@Override
public Hashtable<Element, Transaction> getAttributeWhatWillBeDeleted(long qualifierId, long attributeId) {
    throwExaptionIfNotCan(getAccessor().canUpdateQualifier(qualifierId), "Can not get attributes what will be deleted, as can not update qualifier.");
    List<Element> elements = getElements(qualifierId);
    Hashtable<Element, Transaction> transactions = new Hashtable<Element, Transaction>();
    Attribute attribute = getAttribute(attributeId);
    for (int i = 0; i < elements.size(); i++) {
        Element element = elements.get(i);
        Transaction transaction = getAttributeWhatWillBeDeleted(element.getId(), attribute, true);
        if (transaction.getDelete().size() > 0) {
            transactions.put(element, transaction);
        }
    }
    return transactions;
}
Also used : Transaction(com.ramussoft.common.persistent.Transaction) Attribute(com.ramussoft.common.Attribute) Hashtable(java.util.Hashtable) Element(com.ramussoft.common.Element)

Aggregations

Transaction (com.ramussoft.common.persistent.Transaction)21 Attribute (com.ramussoft.common.Attribute)9 Persistent (com.ramussoft.common.persistent.Persistent)6 ArrayList (java.util.ArrayList)6 Element (com.ramussoft.common.Element)5 FindObject (com.ramussoft.common.attribute.FindObject)5 SQLException (java.sql.SQLException)5 JDBCCallback (com.ramussoft.jdbc.JDBCCallback)4 Connection (java.sql.Connection)4 PreparedStatement (java.sql.PreparedStatement)4 Qualifier (com.ramussoft.common.Qualifier)3 Hashtable (java.util.Hashtable)3 ElementEvent (com.ramussoft.common.event.ElementEvent)2 PersistentField (com.ramussoft.common.persistent.PersistentField)2 PersistentRow (com.ramussoft.common.persistent.PersistentRow)2 PersistentWrapper (com.ramussoft.common.persistent.PersistentWrapper)2 List (java.util.List)2 Engine (com.ramussoft.common.Engine)1 IEngine (com.ramussoft.common.IEngine)1 AbstractAttributeConverter (com.ramussoft.common.attribute.AbstractAttributeConverter)1