@Override public Object call(MethodInvocation mi) { if (disabled(mi)) { throw createException(mi); } return super.call(mi); }
@Override protected void doFilter(String arg0, Object arg1) { if (arg1 instanceof Object[]) { Object[] arr = (Object[]) arg1; for (int i = 0; i < arr.length; i++) { arr[i] = this.filter(arg0, arr[i]); } } }
/** * Similar to how skipFrom and skipWhere were previously used, this sets * the current builder to {@link #where()} but without prefacing the * "where " string. Instead, it adds a space so that further calls to * {@link #where()} also won't add it. This can be used to create a clause * that can later be combined via {@link #subselect(QueryBuilder)}. */ public QueryBuilder whereClause() { current = where; appendSpace(); // Add something empty. return this; }
public Map<String, Long> getLockingIds(final Class<IObject> type, final long id, final Long groupId) { String groupClause = ""; if (groupId != null) { groupClause = "and details.group.id <> " + groupId; } // since it's a managed entity it's class.getName() might // contain // some byte-code generation string final Class<? extends IObject> klass = Utils.trueClass(type); // the values that could possibly link to this instance. final String[][] checks = metadata.getLockChecks(klass); return this.metadata.countLocks(osf.getSession(), id, checks, groupClause); }
private Object getDisablingProxy() { EventMethodInterceptor disable = new EventMethodInterceptor( new EventMethodInterceptor.DisableAction()); return getProxy(disable); }
/** * Appends "and" plus your string unless this is the first where-spec in * which case it is simply appended. */ public QueryBuilder and(String str) { return _where("and ", str); }
@Override @SuppressWarnings("unchecked") protected Array getDataAsArray(Connection conn, Object value) throws SQLException { return factory.STRING2(conn, (List<String[]>) value); }
/** * 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; }
/** * 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; }
@Override @SuppressWarnings("unchecked") protected Array getDataAsArray(Connection conn, Object value) throws SQLException { return factory.FLOAT(conn, (List<Float>) value); }
/** * Walks the data on what locks what * for "from" argument to see if there is any direct relationship to the * "to" argument. If there is, the name will be returned. Otherwise, null. */ public String getRelationship(String from, String to) { Relationship r = _getRelationship(from, to); if (r != null) { return r.relationshipName; } return null; }
@Override @SuppressWarnings("unchecked") protected Array getDataAsArray(Connection conn, Object value) throws SQLException { return factory.BOOLEAN(conn, (List<Boolean>) value); }
@Override @SuppressWarnings("unchecked") protected Array getDataAsArray(Connection conn, Object value) throws SQLException { return factory.DOUBLE(conn, (List<Double>) value); }
@Override @SuppressWarnings("unchecked") protected Array getDataAsArray(Connection conn, Object value) throws SQLException { return factory.STRING(conn, (List<String>) value); }
@Override @SuppressWarnings("unchecked") protected Array getDataAsArray(Connection conn, Object value) throws SQLException { return factory.DATE(conn, (List<Date>) value); }
@Override @SuppressWarnings("unchecked") protected Array getDataAsArray(Connection conn, Object value) throws SQLException { return factory.INTEGER(conn, (List<Integer>) value); }
public EventMethodInterceptor() { this.action = new Action(); }
public QueryBuilder skipFrom() { current = from; appendSpace(); return this; }
/** * Appends "or" plus your string unless this is the first where-spec in * which case it is simply appended. */ public QueryBuilder or(String str) { return _where("or ", str); }
public QueryBuilder skipWhere() { current = where; appendSpace(); return this; }