locksHolder.put(key, new Locks(cm)); for (Class<?> c : hierarchy(m, key)) { Locks locks = locksHolder.get(c.getName()); locks.fillRelationships(sfi, value);
type_list.add(sub_type[j]); addCheck(checks, groupChecks, sub_type[j].getReturnedClass(), path); add(i, name_list.toArray(new String[name_list.size()]), type_list.toArray(new Type[type_list.size()])); } else if (IObject.class.isAssignableFrom(type[i] .getReturnedClass())) { add(i); addCheck(checks, groupChecks, type[i].getReturnedClass(), name[i]);
public String[][] getLockCandidateChecks(Class<? extends IObject> k, boolean onlyWithGroups) { Locks l = locksHolder.get(k.getName()); return l.getLockCandidateChecks(onlyWithGroups); }
String[] names = cm.getPropertyNames(); Locks inverse = locksHolder.get(k); for (int i = 0; i < inverse.size(); i++) { if (!inverse.include(i)) { continue; if (inverse.hasSubtypes(i)) { for (int j = 0; j < inverse.numberOfSubtypes(i); j++) { if (inverse.subtypeEquals(i, j, klass)) { fields.add(new String[] { k, inverse.subtypeName(i, j) });
public IObject[] getLockCandidates(IObject o) { int idx = 0; IObject[] toCheck = new IObject[total()]; Object[] values = cm.getPropertyValues(o, EntityMode.POJO); for (int i = 0; i < size(); i++) { if (!include(i)) { continue; if (hasSubtypes(i)) { for (int j = 0; j < numberOfSubtypes(i); j++) { Object value = getSubtypeValue(i, j, o); if (value != null) { toCheck[idx++] = (IObject) value;
/** * walks the {@link IObject} argument <em>non-</em>recursively and gathers * all {@link IObject} instances which will be linked to by the * creation or updating of the argument. (Previously this was called "locking" * since a flag was set on the object to mark it as linked, but this was * removed in 4.2) * * @param iObject * A newly created or updated {@link IObject} instance which * might possibly lock other {@link IObject IObjects}. A null * argument will return an empty array to be checked. * @return A non-null array of {@link IObject IObjects} which will be linked to. */ public IObject[] getLockCandidates(IObject iObject) { if (iObject == null) { return new IObject[] {}; } Locks l = locksHolder.get(iObject.getClass().getName()); return l.getLockCandidates(iObject); }
/** * returns the number of subtypes for iterating over this secondary array. * If there are no subtypes, this method will return zero. Use * {@link #hasSubtypes(int)} to differentiate the two situations. */ public int numberOfSubtypes(int i) { return hasSubtypes(i) ? subtypes[i].length : 0; }
/** * returns true if this offset points to a field which is an embedded * component. */ public boolean hasSubtypes(int i) { return include(i) && subtypes[i].length > 0; }