/** * Creates a new object by the record received. */ public ORawBuffer(final ORecord iRecord) { this.buffer = iRecord.toStream(); this.version = iRecord.getVersion(); this.recordType = ORecordInternal.getRecordType(iRecord); }
/** * Internal only. Return the record type. */ public static byte getRecordType(final ORecord record) { if (record instanceof ORecordAbstract) { return ((ORecordAbstract) record).getRecordType(); } final ORecordAbstract rec = (ORecordAbstract) record.getRecord(); return rec.getRecordType(); }
public static void setDirtyManager(ORecord record, final ODirtyManager dirtyManager) { if (!(record instanceof ORecordAbstract)) { record = record.getRecord(); } ((ORecordAbstract) record).setDirtyManager(dirtyManager); }
public static void addIdentityChangeListener(ORecord record, final OIdentityChangeListener identityChangeListener) { if (!(record instanceof ORecordAbstract)) { //manage O*Delegate record = record.getRecord(); } if (record instanceof ORecordAbstract) { ((ORecordAbstract) record).addIdentityChangeListener(identityChangeListener); } }
public static ODirtyManager getDirtyManager(ORecord record) { if (!(record instanceof ORecordAbstract)) { record = record.getRecord(); } return ((ORecordAbstract) record).getDirtyManager(); }
@SuppressWarnings({ "unchecked" }) public OTrackedMap<T> setDirty() { if (status != STATUS.UNMARSHALLING && sourceRecord != null && !(sourceRecord.isDirty() && ORecordInternal.isContentChanged(sourceRecord))) sourceRecord.setDirty(); return this; }
protected void onAfterIdentityChanged(final ORecord iRecord) { invokeListenerEvent(ORecordListener.EVENT.IDENTITY_CHANGED); if (newIdentityChangeListeners != null) { for (OIdentityChangeListener changeListener : newIdentityChangeListeners) changeListener.onAfterIdentityChange(this); } }
@Override public <RET> RET detach(RET entity) { ((ORecord)entity).detach(); return entity; }
/** * Internal only. Changes the identity of the record. */ public static ORecordAbstract setIdentity(final ORecord record, final int iClusterId, final long iClusterPosition) { final ORecordAbstract rec = (ORecordAbstract) record; rec.setIdentity(iClusterId, iClusterPosition); return rec; }
@Override public void setDirtyNoChanged() { if (status != STATUS.UNMARSHALLING && sourceRecord != null) sourceRecord.setDirtyNoChanged(); }
/** * Internal only. Sets the version. */ public static void setVersion(final ORecord record, final int iVersion) { final ORecordAbstract rec = (ORecordAbstract) record; rec.setVersion(iVersion); }
@Override public int compare(OIdentifiable o1, OIdentifiable o2) { return rawElement.compare(o1, o2); } }
public ORecordAbstract(final byte[] iSource) { _source = iSource; _size = iSource.length; unsetDirty(); }
public ORecordAbstract fromStream(final byte[] iRecordBuffer) { _dirty = false; _contentChanged = false; _dirtyManager = null; _source = iRecordBuffer; _size = iRecordBuffer != null ? iRecordBuffer.length : 0; _status = ORecordElement.STATUS.LOADED; invokeListenerEvent(ORecordListener.EVENT.UNMARSHALL); return this; }
@Override public ORecordFlat unload() { super.unload(); value = null; return this; }
@SuppressWarnings("unchecked") public OTrackedSet<T> setDirty() { if (status != STATUS.UNMARSHALLING && sourceRecord != null && !(sourceRecord.isDirty() && ORecordInternal.isContentChanged(sourceRecord))) sourceRecord.setDirty(); return this; }
/** * Internal only. Changes the identity of the record. */ public static ORecordAbstract setIdentity(final ORecord record, final ORecordId iIdentity) { final ORecordAbstract rec = (ORecordAbstract) record; rec.setIdentity(iIdentity); return rec; }
@SuppressWarnings("unchecked") public <RET> RET setDirty() { if (status != STATUS.UNMARSHALLING && sourceRecord != null && !(sourceRecord.isDirty() && ORecordInternal.isContentChanged(sourceRecord))) sourceRecord.setDirty(); return (RET) this; }
@SuppressWarnings("unchecked") public ORecordTrackedSet setDirty() { if (status != STATUS.UNMARSHALLING && sourceRecord != null && !(sourceRecord.isDirty() && ORecordInternal.isContentChanged(sourceRecord))) sourceRecord.setDirty(); return this; }