public void clear() { try { property.remove(getObjectConnection(), getResource(), null); } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(); refreshEntity(); }
public void clear() { try { property.remove(getObjectConnection(), getResource(), null); } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(); refreshEntity(); }
/** * This method always returns <code>true</code> * * @return <code>true</code> */ public boolean add(Object o) { ObjectConnection conn = getObjectConnection(); try { Value value = getValue(o); add(conn, getResource(), value); if (value instanceof Resource) { refreshEntity(); } } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(); refresh(o); return true; }
/** * This method always returns <code>true</code> * * @return <code>true</code> */ public boolean remove(Object o) { ObjectConnection conn = getObjectConnection(); try { Value value = getValue(o); remove(conn, getResource(), value); if (value instanceof Resource) { refreshEntity(); } } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(o); refresh(); return true; }
/** * This method always returns <code>true</code> * * @return <code>true</code> */ public boolean add(Object o) { ObjectConnection conn = getObjectConnection(); try { Value value = getValue(o); add(conn, getResource(), value); if (value instanceof Resource) { refreshEntity(); } } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(); refresh(o); return true; }
public boolean retainAll(Collection<?> c) { ObjectConnection conn = getObjectConnection(); boolean modified = false; try { boolean autoCommit = conn.isAutoCommit(); if (autoCommit) conn.setAutoCommit(false); ObjectIterator<?, Object> e = getObjectIterator(); try { while (e.hasNext()) { if (!c.contains(e.next())) { e.remove(); modified = true; } } } finally { e.close(); } if (autoCommit) conn.setAutoCommit(true); } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(); refreshEntity(); return modified; }
/** * Removes the specified element from this set if it is present. * * @return <code>true</code> if this set contained the specified element. */ public boolean remove(Object o) { boolean contained = contains(o); ObjectConnection conn = getObjectConnection(); try { Value value = getValue(o); remove(conn, getResource(), value); if (value instanceof Resource) { refreshEntity(); } } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(o); refresh(); return contained; }
public boolean retainAll(Collection<?> c) { ObjectConnection conn = getObjectConnection(); boolean modified = false; try { boolean autoCommit = conn.isAutoCommit(); if (autoCommit) conn.setAutoCommit(false); ObjectIterator<?, Object> e = getObjectIterator(); try { while (e.hasNext()) { if (!c.contains(e.next())) { e.remove(); modified = true; } } } finally { e.close(); } if (autoCommit) conn.setAutoCommit(true); } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(); refreshEntity(); return modified; }
public boolean addAll(Collection<?> c) { ObjectConnection conn = getObjectConnection(); boolean modified = false; try { boolean autoCommit = conn.isAutoCommit(); if (autoCommit) conn.setAutoCommit(false); try { for (Object o : c) if (add(o)) modified = true; if (autoCommit) conn.setAutoCommit(true); } finally { if (autoCommit && !conn.isAutoCommit()) { conn.rollback(); conn.setAutoCommit(true); } } } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(); refreshEntity(); return modified; }
public boolean addAll(Collection<?> c) { ObjectConnection conn = getObjectConnection(); boolean modified = false; try { boolean autoCommit = conn.isAutoCommit(); if (autoCommit) conn.setAutoCommit(false); try { for (Object o : c) if (add(o)) modified = true; if (autoCommit) conn.setAutoCommit(true); } finally { if (autoCommit && !conn.isAutoCommit()) { conn.rollback(); conn.setAutoCommit(true); } } } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(); refreshEntity(); return modified; }
public boolean removeAll(Collection<?> c) { ObjectConnection conn = getObjectConnection(); boolean modified = false; try { boolean autoCommit = conn.isAutoCommit(); if (autoCommit) conn.setAutoCommit(false); try { for (Object o : c) if (remove(o)) modified = true; if (autoCommit) conn.setAutoCommit(true); } finally { if (autoCommit && !conn.isAutoCommit()) { conn.rollback(); conn.setAutoCommit(true); } } } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(); refreshEntity(); return modified; }
public boolean removeAll(Collection<?> c) { ObjectConnection conn = getObjectConnection(); boolean modified = false; try { boolean autoCommit = conn.isAutoCommit(); if (autoCommit) conn.setAutoCommit(false); try { for (Object o : c) if (remove(o)) modified = true; if (autoCommit) conn.setAutoCommit(true); } finally { if (autoCommit && !conn.isAutoCommit()) { conn.rollback(); conn.setAutoCommit(true); } } } catch (RepositoryException e) { throw new ObjectPersistException(e); } refresh(); refreshEntity(); return modified; }