protected Value getValue(Object instance) throws RepositoryException { return getObjectConnection().addObject(instance); }
protected Value getValue(Object instance) throws RepositoryException { return getObjectConnection().addObject(instance); }
@Override public boolean equals(Object o) { if (o == this) return true; if (!o.getClass().equals(this.getClass())) return false; RemotePropertySet p = (RemotePropertySet) o; if (!getResource().equals(p.getResource())) return false; if (!property.equals(p.property)) return false; if (!getObjectConnection().equals(p.getObjectConnection())) return false; return true; }
@Override public boolean equals(Object o) { if (o == this) return true; if (!o.getClass().equals(this.getClass())) return false; RemotePropertySet p = (RemotePropertySet) o; if (!getResource().equals(p.getResource())) return false; if (!property.equals(p.property)) return false; if (!getObjectConnection().equals(p.getObjectConnection())) return false; return true; }
protected Object createInstance(Value value) throws RepositoryException { if (value instanceof Resource) return getObjectConnection().getObject((Resource) value); return getObjectConnection().getObjectFactory().createObject( ((Literal) value)); }
protected Object createInstance(Value value) throws RepositoryException { if (value instanceof Resource) return getObjectConnection().getObject((Resource) value); return getObjectConnection().getObjectFactory().createObject( ((Literal) value)); }
protected RepositoryResult<Statement> getStatements() throws RepositoryException { ObjectConnection conn = getObjectConnection(); return conn.getStatements(getResource(), getURI(), null); }
protected RepositoryResult<Statement> getStatements() throws RepositoryException { ObjectConnection conn = getObjectConnection(); return conn.getStatements(getResource(), getURI(), null); }
public boolean contains(Object o) { ObjectConnection conn = getObjectConnection(); try { Value val = getValue(o); return conn.hasStatement(getResource(), getURI(), val); } catch (RepositoryException e) { throw new ObjectPersistException(e); } }
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(); }
public boolean contains(Object o) { ObjectConnection conn = getObjectConnection(); try { Value val = getValue(o); return conn.hasStatement(getResource(), getURI(), val); } catch (RepositoryException e) { throw new ObjectPersistException(e); } }
/** * 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; }
/** * 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 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 void setSingle(Object o) { if (o == null) { clear(); } else { ObjectConnection conn = getObjectConnection(); try { boolean autoCommit = conn.isAutoCommit(); if (autoCommit) conn.setAutoCommit(false); try { clear(); add(o); if (autoCommit) conn.setAutoCommit(true); } finally { if (autoCommit && !conn.isAutoCommit()) { conn.rollback(); conn.setAutoCommit(true); } } } catch (RepositoryException e) { throw new ObjectPersistException(e); } } }
public void setSingle(Object o) { if (o == null) { clear(); } else { ObjectConnection conn = getObjectConnection(); try { boolean autoCommit = conn.isAutoCommit(); if (autoCommit) conn.setAutoCommit(false); try { clear(); add(o); if (autoCommit) conn.setAutoCommit(true); } finally { if (autoCommit && !conn.isAutoCommit()) { conn.rollback(); conn.setAutoCommit(true); } } } catch (RepositoryException e) { throw new ObjectPersistException(e); } } }