Try to build an default PBKey for convenience PB create method.

@return PBKey or <code>null</code> if default key was not declared in
metadata
499471
private PBKey buildDefaultKey()
    {
        List descriptors = connectionRepository().getAllDescriptor();
        JdbcConnectionDescriptor descriptor;
        PBKey result = null;
        for (Iterator iterator = descriptors.iterator(); iterator.hasNext();)
        {
            descriptor = (JdbcConnectionDescriptor) iterator.next();
            if (descriptor.isDefaultConnection())
            {
                if(result != null)
                {
                    log.error("Found additional connection descriptor with enabled 'default-connection' "
                            + descriptor.getPBKey() + ". This is NOT allowed. Will use the first found descriptor " + result
                            + " as default connection");
                }
                else
                {
                    result = descriptor.getPBKey();
                }
            }
        }

        if(result == null)
        {
            log.info("No 'default-connection' attribute set in jdbc-connection-descriptors," +
                    " thus it's currently not possible to use 'defaultPersistenceBroker()' " +
                    " convenience method to lookup PersistenceBroker instances. But it's possible"+
                    " to enable this at runtime using 'setDefaultKey' method.");
        }
        return result;
    }
1004181
private RowKeyBuilder initializeRowKeyBuilder() {
		RowKeyBuilder builder = new RowKeyBuilder();
		if ( hasIdentifier ) {
			builder.addColumns( getIdentifierColumnName() );
		}
		else {
			builder.addColumns( getKeyColumnNames() );
			// !isOneToMany() present in delete not in update
			if ( !isOneToMany() && hasIndex && !indexContainsFormula ) {
				builder.addIndexColumns( getIndexColumnNames() );
			}
			else {
				builder.addColumns( getElementColumnNames() );
			}
		}
		return builder;
	}
603742
public static final DefaultTupleMapper newBinaryDefaultTupleMapper( ) {
        return new DefaultTupleMapper(new TupleMapper<String>() {
            @Override
            public String map(Tuple input) {
                try {
                    return new String(input.getBinaryByField(FIELD_SOURCE), "UTF-8");
                } catch (UnsupportedEncodingException e) {
                    throw new MappingException("Error while processing source as a byte[]", e);
                }
            }
        });
    }
454359
public static synchronized Document getDefaultDocument()
    {
        if (defaultDocument == null)
        {
            DocumentBuilderFactory documentBuilderFactory = 
                DocumentBuilderFactory.newInstance();
            DocumentBuilder documentBuilder = null;
            try
            {
                documentBuilder = documentBuilderFactory.newDocumentBuilder();
            }
            catch (ParserConfigurationException e)
            {
                // Can not happen, since it's the default configuration
                throw new XmlException("Could not create default document", e);
            }
            defaultDocument = documentBuilder.newDocument();
        }
        return defaultDocument;
    }
152661
public OneKey PublicKey()
    {
        OneKey newKey = new OneKey();
        CBORObject val = this.get(KeyKeys.KeyType);
        if (val.equals(KeyKeys.KeyType_Octet)) {
            return null;
        }
        else if (val.equals(KeyKeys.KeyType_EC2)) {
            newKey.add(KeyKeys.EC2_Curve, get(KeyKeys.EC2_Curve));
            newKey.add(KeyKeys.EC2_X, get(KeyKeys.EC2_X));
            newKey.add(KeyKeys.EC2_Y, get(KeyKeys.EC2_Y));
        }
        /*
        else if (val.equals(KeyKeys.KeyType_OKP)) {
            newKey.add(KeyKeys.OKP_Curve, get(KeyKeys.OKP_Curve));
            newKey.add(KeyKeys.OKP_X, get(KeyKeys.OKP_X));
        }
        */
        else {
            return null;
        }
        
        //  Allow them to use the same underlying public key object
        
        newKey.publicKey = publicKey;

        for (CBORObject obj : keyMap.getKeys()) {
            val = keyMap.get(obj);
            if (obj.getType() == CBORType.Number) {
                if (obj.AsInt32() > 0) {
                    newKey.add(obj, val);
                }
            }
            else if (obj.getType() == CBORType.TextString) {
                newKey.add(obj, val);
            }
        }
        return newKey;
    }
332440
public function getEditAfterCreateConfigKey()
    {
        $keys = array_keys($this->getConfig(self::TYPE_DEFAULT));
        if (!$keys) return null;
        return $keys[0];
    }
115827
public static OkHttpClient.Builder defaultOkHttpClientBuilder() {
        return new OkHttpClient.Builder()
            .connectTimeout(DEFAULT_CONNECT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)
            .readTimeout(DEFAULT_READ_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)
            .writeTimeout(DEFAULT_READ_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)
            // enables certificate pinning
            .sslSocketFactory(SSLConfig.getSSLSocketFactory(), SSLConfig.getTrustManager());
    }
921613
public Configuration create() {
        Configuration configuration;
        try {
            InputStream stream = null;
            try {
                // Search the user configuration
                stream = Utils.openResourceStream(DEFAULT_USER_CONFIGURATION_FILE);

                // If user configuration not found then use default
                if (stream == null) {
                    stream = Utils.openResourceStream(DEFAULT_CONFIGURATION_FILE);
                }

                if (stream != null) {
                    configuration = create(stream);
                } else {
                    throw new TextProcessorFactoryException("Can't find or open default configuration resource.");
                }
            } finally {
                if (stream != null) {
                    stream.close();
                }
            }

            Properties properties = new Properties();

            // Load properties from .property file
            InputStream propertiesStream = null;
            try {
                propertiesStream = Utils.openResourceStream(DEFAULT_PROPERTIES_FILE);
                if (propertiesStream != null) {
                    properties.load(propertiesStream);
                }
            } finally {
                if (propertiesStream != null) {
                    propertiesStream.close();
                }
            }

            // Load properties from xml file
            InputStream xmlPropertiesStream = null;
            try {
                xmlPropertiesStream = Utils.openResourceStream(DEFAULT_PROPERTIES_XML_FILE);
                if (xmlPropertiesStream != null) {
                    properties.loadFromXML(xmlPropertiesStream);
                }
            } finally {
                if (xmlPropertiesStream != null) {
                    xmlPropertiesStream.close();
                }
            }

            if (!properties.isEmpty()) {
                Map<String, CharSequence> params = new HashMap<String, CharSequence>();
                params.putAll(configuration.getParams());
                for (Map.Entry<Object, Object> entry : properties.entrySet()) {
                    Object key = entry.getKey();
                    if (key != null) {
                        params.put(key.toString(), entry.getValue().toString());
                    }
                }
                configuration.setParams(params);
            }
        } catch (IOException e) {
            throw new TextProcessorFactoryException(e);
        }

        return configuration;
    }
76822
public function getAutoIncrementPrimaryKey()
    {
        if ($this->getIdMethod() != IDMethod::NO_ID_METHOD) {
            $pks = $this->getPrimaryKey();
            foreach ($pks as $pk) {
                if ($pk->isAutoIncrement()) {
                    return $pk;
                }
            }
        }

        return null;
    }
418286
public Object getPrimaryKey() throws javax.ejb.EJBException
    {
        HomeInternal hi = beanId.getHome();

        if (hi.isStatelessSessionHome() || hi.isStatefulSessionHome()) {
            throw new IllegalSessionMethodLocalException();
        }

        //PK26539: copy the primary key (see WASInternal_copyPrimaryKey for explanation)
        return ((EJSHome) hi).WASInternal_copyPrimaryKey(beanId.getPrimaryKey());
    }
787524
protected String buildDefaultMavenCoordinates() {
        StringBuilder sb = new StringBuilder();
        sb.append(getGroupId()).append(":");
        sb.append(getArtifactId());
        if (StringUtils.isNotBlank(getType())) {
            sb.append(":").append(getType());
        }
        if (StringUtils.isNotBlank(getClassifier())) {
            sb.append(":").append(getClassifier());
        }
        sb.append(":");
        sb.append(getVersion());
        return sb.toString().trim();
    }
1037229
@Override
  public String key() {
    return new StringBuilder().append(projectKey).append(":").append(projectRelativePath).toString();
  }
996645
@Override
  public Key getParent() {
    List<PathElement> ancestors = getAncestors();
    if (ancestors.isEmpty()) {
      return null;
    }
    PathElement parent = ancestors.get(ancestors.size() - 1);
    Key.Builder keyBuilder;
    if (parent.hasName()) {
      keyBuilder = Key.newBuilder(getProjectId(), parent.getKind(), parent.getName());
    } else {
      keyBuilder = Key.newBuilder(getProjectId(), parent.getKind(), parent.getId());
    }
    String namespace = getNamespace();
    if (namespace != null) {
      keyBuilder.setNamespace(namespace);
    }
    return keyBuilder.addAncestors(ancestors.subList(0, ancestors.size() - 1)).build();
  }
38764
public T getDefaultExtension() {
        getExtensionClasses();
        if (null == cachedDefaultName || cachedDefaultName.length() == 0 || "true".equals(cachedDefaultName)) {
            return null;
        }
        return getExtension(cachedDefaultName);
    }
807679
public static HealthCheckRegistry tryGetDefault() {
        final String name = defaultRegistryName.get();
        if (name != null) {
            return getOrCreate(name);
        }
        return null;
    }
1370464
public static PBKey crossCheckPBKey(PBKey key)
    {
        if(key.getUser() == null)
        {
            PBKey defKey = MetadataManager.getInstance().connectionRepository().getStandardPBKeyForJcdAlias(key.getAlias());
            if(defKey != null)
            {
                return defKey;
            }
        }
        return key;
    }
20822
@SuppressWarnings("unchecked")
    protected K createKey(QueryParameters params) throws MjdbcException {
        K result = null;

        if (columnName == null) {
            result = (K) params.getValue(params.getNameByPosition(columnIndex));
        } else {
            result = (K) params.getValue(columnName);
        }

        return result;
    }