Refine search
/** * When the event type is not PAYLOAD_EXTENTS, return the set of * object IDs for updated objects. When the event type is * PAYLOAD_LOCAL_STALE_DETECTION, items in this list may actually have * been deleted from the database. */ public Collection getUpdatedObjectIds() { if (_payload == PAYLOAD_EXTENTS) throw new UserException(s_loc.get("extent-only-event")); return (_updates == null) ? Collections.EMPTY_LIST : _updates; }
/** * When the event type is PAYLOAD_EXTENTS, return the set of class * names for the classes of updated objects. */ public Collection getUpdatedTypeNames() { if (_payload != PAYLOAD_EXTENTS) throw new UserException(s_loc.get("nonextent-event")); return (_updates == null) ? Collections.EMPTY_LIST : _updates; }
/** * When the event type is not PAYLOAD_EXTENTS, return the set of * object IDs for deleted objects. */ public Collection getDeletedObjectIds() { if (_payload == PAYLOAD_EXTENTS) throw new UserException(s_loc.get("extent-only-event")); return (_deletes == null) ? Collections.EMPTY_LIST : _deletes; }
public void setValueMappedBy(String mapped) { if (_owner.getKey() != this && mapped != null) throw new UserException(_loc.get("mapped-by-not-key", this)); else { _mappedBy = mapped; _mappedByMeta = null; } }
protected Object eval(Object candidate, Object orig, StoreContext ctx, Object[] params) { if (candidate == null) candidate = Collections.EMPTY_LIST; // allow aggregates to be used in filter expressions so long as a // collection is passed in if (candidate instanceof Collection) return eval((Collection) candidate, orig, ctx, params). iterator().next(); throw new UserException(_loc.get("agg-in-filter")); }
public void setRetainState(boolean val) { assertOpen(); if ((_flags & FLAG_PRESTORING) != 0) throw new UserException(_loc.get("illegal-op-in-prestore")); _retainState = val; }
public void addListener(RemoteCommitListener listen) { if (_provider == null) throw new UserException(_loc.get("no-provider")); super.addListener(listen); }
public void setValueMappedBy(String mapped) { if (_owner.getKey() != this && mapped != null) throw new UserException(_loc.get("mapped-by-not-key", this)); else { _mappedBy = mapped; _mappedByMeta = null; } }
public void setNontransactionalWrite(boolean val) { assertOpen(); if ((_flags & FLAG_PRESTORING) != 0) throw new UserException(_loc.get("illegal-op-in-prestore")); _nontransWrite = val; }
/** * Asserts consistencey of given automatic detachment option value. */ private void assertAutoDetachValue(int value) { if (((value & AutoDetach.DETACH_NONE) != 0) && (value != AutoDetach.DETACH_NONE)) { throw new UserException(_loc.get("detach-none-exclusive", toAutoDetachString(value))); } }
/** * Ensure that conversion is possible. */ private void assertConvertable(Class<?> candidate, Class<?>[] types, Class<?> resultClass) { Class<?> c = (types == null) ? candidate : types[0]; if ((types != null && types.length != 1) || (c != null && c != Object.class && !Filters.canConvert(c, resultClass, true))) throw new UserException(_loc.get("cant-convert-result", c, resultClass)); }
/** * Throw all gathered exceptions. */ private void throwExceptions(List exceps) { if (exceps == null) return; if (exceps.size() == 1) throw (RuntimeException) exceps.get(0); throw new UserException(_loc.get("nested-exceps")). setNestedThrowables((Throwable[]) exceps.toArray (new Throwable[exceps.size()])); }
public void setNontransactionalWrite(boolean val) { assertOpen(); if ((_flags & FLAG_PRESTORING) != 0) throw new UserException(_loc.get("illegal-op-in-prestore")); _nontransWrite = val; }
public void setRetainState(boolean val) { assertOpen(); if ((_flags & FLAG_PRESTORING) != 0) throw new UserException(_loc.get("illegal-op-in-prestore")); _retainState = val; }
public ObjectName getObjectName() { if (_objName != null) { return _objName; } try { _objName = JMXProvider.createObjectName(this, null); return _objName; } catch (Throwable t) { throw new UserException(_loc.get("unable-to-create-object-name", getName()), t); } }
/** * Copy fields from an outside source to the key fields in the identity * object. */ public static void copyKeyFieldsToObjectId(Class<?> pcClass, FieldSupplier fm, Object oid) { Meta meta = getMeta(pcClass); if (meta.pc == null) throw new UserException(_loc.get("copy-no-id", pcClass)); meta.pc.pcCopyKeyFieldsToObjectId(fm, oid); }
/** * Copies the given collection. */ private Collection copyCollection(AttachManager manager, Collection orig, FieldMetaData fmd) { Collection coll = manager.getProxyManager().copyCollection(orig); if (coll == null) throw new UserException(_loc.get("not-copyable", fmd)); return coll; }
public ObjectName getObjectName() { if (_objName != null) { return _objName; } try { _objName = JMXProvider.createObjectName(this, null); return _objName; } catch (Throwable t) { throw new UserException(_loc.get("unable-to-create-object-name", getName()), t); } }
/** * Throw an exception indicating that the current action can't be * performed on a detached object. */ private OpenJPAException newDetachedException(Object obj, String operation) { throw new UserException(_loc.get("bad-detached-op", operation, Exceptions.toString(obj))).setFailedObject(obj); }
/** * Copy fields from an outside source to the key fields in the identity * object. */ public static void copyKeyFieldsToObjectId(Class<?> pcClass, FieldSupplier fm, Object oid) { Meta meta = getMeta(pcClass); if (meta.pc == null) throw new UserException(_loc.get("copy-no-id", pcClass)); meta.pc.pcCopyKeyFieldsToObjectId(fm, oid); }