@Override public boolean equals(Object obj) { if (obj == this) return true; if (!super.equals(obj)) return false; final MapValueIndexInfo that = (MapValueIndexInfo)obj; return this.keyFieldStorageId == that.keyFieldStorageId && this.keyFieldType.equals(that.keyFieldType) && Objects.equals(this.keyEnumType, that.keyEnumType); }
/** * Recurse on this reference sub-field during a copy between transactions. Copies all objects referred to by * this sub-field in the given object from {@code srcTx} to {@code dstTx}. * * <p> * This method assumes that this indexed field is a reference field. * * @param copyState copy state * @param srcTx source transaction * @param dstTx destination transaction * @param id ID of the object containing the complex field and sub-field in {@code srcTx} * @param fieldIndex next index into {@code fieldIds} * @param fields fields to follow in the reference path */ public void copyRecurse(CopyState copyState, JTransaction srcTx, JTransaction dstTx, ObjId id, int fieldIndex, int[] fields) { assert this.getFieldType() instanceof ReferenceFieldType; for (Object obj : this.iterateReferences(srcTx.tx, id)) { if (obj != null) srcTx.copyTo(copyState, dstTx, (ObjId)obj, false, fieldIndex, fields); } }
@Override protected String toStringPrefix() { return super.toStringPrefix() + ",parentStorageId=" + this.getParentStorageId(); }
@Override protected String toStringPrefix() { return super.toStringPrefix() + ",keyFieldStorageId=" + this.keyFieldStorageId + ",keyFieldType=" + this.keyFieldType + (this.keyEnumType != null ? ",keyEnumType=" + this.keyEnumType : ""); }
@Override public int hashCode() { return super.hashCode() ^ this.keyFieldStorageId ^ this.keyFieldType.hashCode() ^ Objects.hashCode(this.keyEnumType); } }
private void gatherForwardCascadeRefs(ObjId id, String cascadeName, ObjIdSet visitedIds, ObjIdSet toVisitIds) { final JClass<?> jclass = this.jdb.jclasses.get(id.getStorageId()); if (jclass == null) return; final List<JReferenceField> fieldList = jclass.forwardCascadeMap.get(cascadeName); if (fieldList == null) return; for (JReferenceField field : fieldList) { final SimpleFieldIndexInfo info = (SimpleFieldIndexInfo)this.jdb.indexInfoMap.get(field.storageId); assert info.getFieldType() instanceof ReferenceFieldType; if (info instanceof ComplexSubFieldIndexInfo) { final ComplexSubFieldIndexInfo subFieldInfo = (ComplexSubFieldIndexInfo)info; this.gatherRefs(subFieldInfo.iterateReferences(this.tx, id).iterator(), visitedIds, toVisitIds); } else { final ObjId referrent = (ObjId)this.tx.readSimpleField(id, field.storageId, false); if (referrent != null && visitedIds.add(referrent)) toVisitIds.add(referrent); } } }
if (info instanceof ComplexSubFieldIndexInfo) { final ComplexSubFieldIndexInfo subFieldInfo = (ComplexSubFieldIndexInfo)info; subFieldInfo.copyRecurse(copyState, this, dest, srcId, fieldIndex, fields); } else { final ObjId referrent = (ObjId)this.tx.readSimpleField(srcId, storageId, false);