region > findByOwner (programmatic)
547149
@Programmatic
    public List<CommunicationChannelOwnerLink> findByOwner(final CommunicationChannelOwner owner) {
        if(owner == null) {
            return null;
        }
        final Bookmark bookmark = bookmarkService.bookmarkFor(owner);
        if(bookmark == null) {
            return null;
        }
        return container.allMatches(
                new QueryDefault<>(CommunicationChannelOwnerLink.class,
                        "findByOwner",
                        "ownerObjectType", bookmark.getObjectType(),
                        "ownerIdentifier", bookmark.getIdentifier()));
    }
1133916
@Programmatic
    public PostalAddress findByAddress(
            final Object owner,
            final String placeId) {

        final List<CommunicationChannelOwnerLink> links =
                linkRepository.findByOwnerAndCommunicationChannelType(owner, CommunicationChannelType.POSTAL_ADDRESS);
        final Iterable<PostalAddress> postalAddresses =
                Iterables.transform(
                        links,
                        CommunicationChannelOwnerLink.Functions.communicationChannel(PostalAddress.class));
        final Optional<PostalAddress> postalAddressIfFound =
                Iterables.tryFind(postalAddresses, input -> Objects.equals(placeId, input.getPlaceId()));
        return postalAddressIfFound.orNull();
    }
896539
@Override
    @Transactional
    public Dashboard findDashboardByNameAndOwner(String name, PrincipalUser owner) {
        requireNotDisposed();
        requireArgument(name != null && !name.isEmpty(), "Dashboard name cannot be null or empty");
        requireArgument(owner != null, "Owner of the dashboard cannot be null");
        _logger.debug("Querying Dashboard by name: {} and owned by: {}", name, owner);

        Dashboard dashboard = Dashboard.findByNameAndOwner(emf.get(), name, owner);

        _logger.debug("Found Dashboard: {}", dashboard);
        return dashboard;
    }
806570
def owner(self):
        
        obj = javabridge.call(self.jobject, "getOwner", "()Lweka/core/CapabilitiesHandler;")
        if obj is None:
            return None
        else:
            return JavaObject(jobject=obj)
186646
@Programmatic
    public PostalAddress findByAddress(
            final CommunicationChannelOwner owner, 
            final String address1, 
            final String postalCode, 
            final String city, 
            final Country country) {

        final List<CommunicationChannelOwnerLink> links =
                communicationChannelOwnerLinkRepository.findByOwnerAndCommunicationChannelType(owner, CommunicationChannelType.POSTAL_ADDRESS);
        final Iterable<PostalAddress> postalAddresses =
                Iterables.transform(
                        links,
                        CommunicationChannelOwnerLink.Functions.communicationChannel(PostalAddress.class));
        final Optional<PostalAddress> postalAddressIfFound =
                Iterables.tryFind(postalAddresses, PostalAddress.Predicates.equalTo(address1, postalCode, city, country));
        return postalAddressIfFound.orNull();
    }
383973
@Override
	public SQLProperty findPropertyByName(String name) {
		name = name.toLowerCase();
		for (SQLProperty item : properties) {
			if (item.getName().toLowerCase().equals(name)) {
				return item;
			}
		}

		return null;
	}
266233
@SuppressWarnings("unchecked")
  @Override
  public <T> T findById(Object id, String collectionName) {
    CollectionMetaData cmd = cmdMap.get(collectionName);
    Map<Object, T> collection = (Map<Object, T>) collectionsRef.get().get(collectionName);
    if((null == cmd) || null == collection) {
      throw new InvalidJsonDbApiUsageException("Collection by name '" + collectionName + "' not found. Create collection first.");
    }
    cmd.getCollectionLock().readLock().lock();
    try {
      Object obj = Util.deepCopy(collection.get(id));
      if(encrypted && cmd.hasSecret() && null != obj){
        CryptoUtil.decryptFields(obj, cmd, dbConfig.getCipher());
      }
      return (T) obj;
    } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
      logger.error("Error when decrypting value for a @Secret annotated field for entity: " + collectionName, e);
      throw new JsonDBException("Error when decrypting value for a @Secret annotated field for entity: " + collectionName, e);
    } finally {
      cmd.getCollectionLock().readLock().unlock();
    }
  }
469497
public static final FileAttribute<UserPrincipal> getOwnerAsAttribute(String owner) throws IOException
    {
        if (supports("posix"))
        {
            UserPrincipalLookupService upls = FileSystems.getDefault().getUserPrincipalLookupService();
            UserPrincipal user = upls.lookupPrincipalByName(owner);
            return new FileAttributeImpl<>("posix:owner", user);
        }
        else
        {
            return null;
        }
    }
1018554
public PropertyOwner retrieveUserProperties(String strRegistrationKey)
    {
        if (m_properties != null)
            if (m_properties.get(strRegistrationKey) != null)
                return this;
        return m_databaseOwner.retrieveUserProperties(strRegistrationKey);
    }
1175598
public PropertyOwner retrieveUserProperties(String strRegistrationKey)
    {
        if (this.getTask() != null)
            return this.getTask().retrieveUserProperties(strRegistrationKey);
        return null;    // Not found
    }
682425
@SuppressWarnings("unchecked")
    @Override
	public <T> T by(int userId) {
	    User sfsUser = api.getUserById(userId);
	    if(sfsUser != null)
	        return (T)sfsUser.getProperty(APIKey.USER);
	    return null;
	}
629007
function findOwnerStack(instance) {
    if (!instance) {
      return [];
    }

    var stack = [];
    do {
      stack.push(instance);
    } while (instance = instance._currentElement._owner);
    stack.reverse();
    return stack;
  }
1001501
@Programmatic
    public PhoneOrFaxNumber findByPhoneOrFaxNumber(
            final Object owner,
            final String phoneNumber) {

        final Optional<PhoneOrFaxNumber> phoneNumberIfFound = findByPhoneOrFaxNumber(owner, phoneNumber, CommunicationChannelType.PHONE_NUMBER);
        if(phoneNumberIfFound.isPresent()) {
            return phoneNumberIfFound.get();
        }

        final Optional<PhoneOrFaxNumber> faxNumberIfFound = findByPhoneOrFaxNumber(owner, phoneNumber, CommunicationChannelType.FAX_NUMBER);
        return faxNumberIfFound.orNull();
    }
199359
protected Binder findBinderByPropertyName(Class parentObjectType, String propertyName) {
        PropertyNameKey key = new PropertyNameKey(parentObjectType, propertyName);
        Binder binder = (Binder)propertyNameBinders.get(key);
        if (binder == null) {
            // if no direct match was found try to find a match in any super classes
            final Map potentialMatchingBinders = new HashMap();
            for (Iterator i = propertyNameBinders.entrySet().iterator(); i.hasNext();) {
                Map.Entry entry = (Map.Entry)i.next();
                if (((PropertyNameKey)entry.getKey()).getPropertyName().equals(propertyName)) {
                    potentialMatchingBinders.put(((PropertyNameKey)entry.getKey()).getParentObjectType(),
                            entry.getValue());
                }
            }
            binder = (Binder) ClassUtils.getValueFromMapForClass(parentObjectType, potentialMatchingBinders);
            if (binder != null) {
                // remember the lookup so it doesn't have to be discovered again
                registerBinderForPropertyName(parentObjectType, propertyName, binder);
            }
        }
        return binder;
    }
645350
def build_owner(args):
    """"""
    if args.sort_by == 'cover':
        return CoverageOwners(args.root, args.verbose)
    if os.path.isdir(args.root):
        pass
    else:  # File
        args.root, args.filter = os.path.split(args.root)
    if args.sort_by == 'date':
        return DateOwners(args.root, args.filter, args.details,
                          args.verbose, args.max)
    else:  # by size
        return SizeOwners(args.root, args.filter, args.details,
                          args.verbose, args.max)
182213
@SuppressWarnings("unchecked")
    public <T> List<Serializable> findId(Class<T> clazz, SearchParameters sp, List<SingularAttribute<?, ?>> availableProperties) {
        //log.info("Searching {} with terms : {} with available Properties: {}", new Object[]{clazz.getSimpleName(), sp.getTerms(), availableProperties});
        FullTextEntityManager fullTextEntityManager = getFullTextEntityManager(entityManager);
        Query query = sp.getLuceneQueryBuilder().build(fullTextEntityManager, sp, availableProperties);

        if (query == null) {
            return null;
        }

        FullTextQuery ftq = fullTextEntityManager.createFullTextQuery( //
                query, clazz);
        ftq.setProjection("id");
        if (sp.getMaxResults() > 0) {
            ftq.setMaxResults(sp.getMaxResults());
        }
        List<Serializable> ids = newArrayList();
        List<Object[]> resultList = ftq.getResultList();
        for (Object[] result : resultList) {
            ids.add((Serializable) result[0]);
        }
        return ids;
    }
558103
def get(self, copy=False):
        """"""
        array = getattr(self.owner, self.name)
        if copy:
            return array.copy()
        else:
            return array