Select records from database table using <I>obj</I> object as template
for selection.

@param obj example object for search.
@param mask field mask indicating which fields in the example object
should be used when building the query.
180777
public final Cursor<T> queryByExample (Connection conn, T obj,
                                           FieldMask mask)
    {
        return new Cursor<T>(this, conn, obj, mask, false);
    }
420412
public static <E> Filter<E> collectionRejectFilter(E[] objs) {
    return new CollectionAcceptFilter<E>(Arrays.asList(objs), false);
  }
1028647
public void setControlValue(Object objValue)
    {
        try   {
            if (!(this.getConverter() instanceof FieldInfo))
                objValue = null;
            if (objValue instanceof String)
                objValue = ((FieldInfo)this.getConverter()).stringToDate((String)objValue);
        } catch (Exception ex)  {
            objValue = null;
        }
        this.setTargetDate((Date)objValue);
    }
146227
public void setKeyValues(String keyName, Object obj)
    {
        if (this.keyValues == null)
        {
            this.keyValues = new HashMap<String, Object>();
        }
        this.keyValues.put(keyName, obj);
    }
1287493
public static ObjectNode getObj(ObjectNode obj, String fieldName) {
		return obj != null ? obj(obj.get(fieldName)) : null;
	}
1226056
@Override
    public void visitCode(final Code obj) {
        stack.resetForMethodEntry(this);
        indexToFieldMap.clear();
        super.visitCode(obj);
    }
174899
public List getMtoNImplementor(CollectionDescriptor cod, Object obj)
    {
        ResultSetAndStatement rs = null;
        ArrayList result = new ArrayList();
        ClassDescriptor cld = pb.getDescriptorRepository().getDescriptorFor(obj.getClass());
        ValueContainer[] pkValues = pb.serviceBrokerHelper().getKeyValues(cld, obj);
        String[] pkColumns = cod.getFksToThisClass();
        String[] fkColumns = cod.getFksToItemClass();
        String table = cod.getIndirectionTable();

        String selectStmt = pb.serviceSqlGenerator().getSelectMNStatement(table, fkColumns, pkColumns);

        ClassDescriptor itemCLD = pb.getDescriptorRepository().getDescriptorFor(cod.getItemClass());
        Collection extents = pb.getDescriptorRepository().getAllConcreteSubclassDescriptors(itemCLD);
        if(extents.size() > 0)
        {
            itemCLD = (ClassDescriptor) extents.iterator().next();
        }
        FieldDescriptor[] itemClassPKFields = itemCLD.getPkFields();
        if(itemClassPKFields.length != fkColumns.length)
        {
            throw new PersistenceBrokerException("All pk fields of the element-class need to" +
                    " be declared in the indirection table. Element class is "
                    + itemCLD.getClassNameOfObject() + " with " + itemClassPKFields.length + " pk-fields." +
                    " Declared 'fk-pointing-to-element-class' elements in collection-descriptor are"
                    + fkColumns.length);
        }
        try
        {
            rs = pb.serviceJdbcAccess().executeSQL(selectStmt, cld, pkValues, Query.NOT_SCROLLABLE);
            while(rs.m_rs.next())
            {
                ValueContainer[] row = new ValueContainer[fkColumns.length];
                for(int i = 0; i < row.length; i++)
                {
                    row[i] = new ValueContainer(rs.m_rs.getObject(i + 1), itemClassPKFields[i].getJdbcType());
                }
                result.add(new MtoNBroker.Key(row));
            }
        }
        catch(PersistenceBrokerException e)
        {
            throw e;
        }
        catch(SQLException e)
        {
            throw new PersistenceBrokerSQLException(e);
        }
        finally
        {
            if(rs != null) rs.close();
        }
        return result;
    }
237231
function filter(obj) {
    var result = {}, fieldDefine, value;
    for(var field in options) {
      fieldDefine = options[field];
      value = obj[field];
      if(!fieldDefine.private && value !== undefined) {
        result[field] = value;
      }
    }
    return result;
  }
967690
public void deleteMtoNImplementor(CollectionDescriptor cod, Object obj)
    {
        ClassDescriptor cld = pb.getDescriptorRepository().getDescriptorFor(obj.getClass());
        ValueContainer[] pkValues = pb.serviceBrokerHelper().getKeyValues(cld, obj);
        String[] pkColumns = cod.getFksToThisClass();
        String table = cod.getIndirectionTable();
        String deleteStmt = pb.serviceSqlGenerator().getDeleteMNStatement(table, pkColumns, null);
        pb.serviceJdbcAccess().executeUpdateSQL(deleteStmt, cld, pkValues, null);
    }
1266307
@Override
    public void visitCode(Code obj) {
        try {
            userValues = new HashMap<>();
            super.visitCode(obj);
        } finally {
            userValues = null;
        }
    }
694913
public static void setPrivateField(final Object obj, final String name, final Object value) {
        try {
            final Field field = obj.getClass().getDeclaredField(name);
            field.setAccessible(true);
            field.set(obj, value);
        } catch (final Exception ex) {
            throw new RuntimeException("Couldn't set field '" + name + "' in class '" + obj.getClass() + "'", ex);
        }
    }
473192
def _format_object_mask(objectmask):
    
    objectmask = objectmask.strip()

    if (not objectmask.startswith('mask') and
            not objectmask.startswith('[')):
        objectmask = "mask[%s]" % objectmask
    return objectmask
867892
public void updateLockingValues(Object obj) throws PersistenceBrokerException
    {
        FieldDescriptor[] fields = getLockingFields();
        for (int i = 0; i < fields.length; i++)
        {
            FieldDescriptor fmd = fields[i];
            if (fmd.isUpdateLock())
            {
                PersistentField f = fmd.getPersistentField();
                Object cv = f.get(obj);
                // int
                if ((f.getType() == int.class) || (f.getType() == Integer.class))
                {
                    int newCv = 0;
                    if (cv != null)
                    {
                        newCv = ((Number) cv).intValue();
                    }
                    newCv++;
                    f.set(obj, new Integer(newCv));
                }
                // long
                else if ((f.getType() == long.class) || (f.getType() == Long.class))
                {
                    long newCv = 0;
                    if (cv != null)
                    {
                        newCv = ((Number) cv).longValue();
                    }
                    newCv++;
                    f.set(obj, new Long(newCv));
                }
                // Timestamp
                else if (f.getType() == Timestamp.class)
                {
                    long newCv = System.currentTimeMillis();
                    f.set(obj, new Timestamp(newCv));
                }
            }
        }
    }
674164
protected void _format(EObject obj, IFormattableDocument document) {
		for (EObject child : obj.eContents())
			document.format(child);
	}
1122874
@Override
    public void visitField(Field obj) {
        if (checkConfusedName(obj.getName(), obj.getSignature())) {
            bugReporter.reportBug(new BugInstance(this, BugType.CNC_COLLECTION_NAMING_CONFUSION.name(), NORMAL_PRIORITY).addClass(this).addField(this)
                    .addString(obj.getName()));
        }
    }
285859
def eventFilter(self, object, event):
        
        edit = self.lineEdit()
        
        if not (object and object == self._treePopupWidget):
            return super(XOrbRecordBox, self).eventFilter(object, event)
        
        elif event.type() == event.Show:
            object.resizeToContents()
            object.horizontalScrollBar().setValue(0)
        
        elif edit and event.type() == event.KeyPress:
            # accept lookup
            if event.key() in (Qt.Key_Enter,
                               Qt.Key_Return,
                               Qt.Key_Tab,
                               Qt.Key_Backtab):
                
                item = object.currentItem()
                text = edit.text()
                
                if not text:
                    record = None
                    item = None
                
                elif isinstance(item, XOrbRecordItem):
                    record = item.record()
                
                if record and item.isSelected() and not item.isHidden():
                    self.hidePopup()
                    self.setCurrentRecord(record)
                    event.accept()
                    return True
                
                else:
                    self.setCurrentRecord(None)
                    self.hidePopup()
                    edit.setText(text)
                    edit.keyPressEvent(event)
                    event.accept()
                    return True
                
            # cancel lookup
            elif event.key() == Qt.Key_Escape:
                text = edit.text()
                self.setCurrentRecord(None)
                edit.setText(text)
                self.hidePopup()
                event.accept()
                return True
            
            # update the search info
            else:
                edit.keyPressEvent(event)
        
        elif edit and event.type() == event.KeyRelease:
            edit.keyReleaseEvent(event)
        
        elif edit and event.type() == event.MouseButtonPress:
            local_pos = object.mapFromGlobal(event.globalPos())
            in_widget = object.rect().contains(local_pos)
            
            if not in_widget:
                text = edit.text()
                self.setCurrentRecord(None)
                edit.setText(text)
                self.hidePopup()
                event.accept()
                return True
            
        return super(XOrbRecordBox, self).eventFilter(object, event)
1276569
public synchronized static RecordAccessor getRecordAccessorForObject(Object obj) {
    for (RecordAccessorProvider p: recordAccessorProviders) {
      RecordAccessor accessor = p.recordAccessorForObject(obj);
      if (accessor != null) {
        return accessor;
      }
    }

    throw new IllegalArgumentException("Can't build accessor for object " + obj.toString() + "!");
  }