Namers declared here can be overridden easily through configuration.

@param entity
546853
private void namerDefault(Entity entity) {
        entity.put("searchForm", new ClassNamer2(entity, null, "web.domain", null, "SearchForm"));
        entity.put("editForm", new ClassNamer2(entity, null, "web.domain", null, "EditForm"));
        entity.put("graphLoader", new ClassNamer2(entity, null, "web.domain", null, "GraphLoader"));
        entity.put("controller", new ClassNamer2(entity, null, "web.domain", null, "Controller"));
        entity.put("excelExporter", new ClassNamer2(entity, null, "web.domain", null, "ExcelExporter"));
        entity.put("lazyDataModel", new ClassNamer2(entity, null, "web.domain", null, "LazyDataModel"));
        entity.put("fileUpload", new ClassNamer2(entity, null, "web.domain", null, "FileUpload"));
        entity.put("fileDownload", new ClassNamer2(entity, null, "web.domain", null, "FileDownload"));
    }
137434
private void addPropertyName(Document doc, InternalQName name) throws RepositoryException
   {
      String fieldName = name.getName();
      try
      {
         fieldName = resolver.createJCRName(name).getAsString();
      }
      catch (NamespaceException e)
      {
         // will never happen
         if (LOG.isTraceEnabled())
         {
            LOG.trace("An exception occurred: " + e.getMessage());
         }
      }
      doc.add(new Field(FieldNames.PROPERTIES_SET, fieldName, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
   }
1341202
public void setRegistrationName(String name) {
    NamespaceService[] nsos = namespaceManager.getAllNamenodeThreads();
    for (NamespaceService ns : nsos) {
      ((NSOfferService) ns).setRegistrationName(name);
    }
  }
955151
private void genAttributes(final Element ent, final ResourceXMLParser.Entity entity) {
        if (null == entity.getProperties() ) {
            return;
        }
        for (final String key:entity.getProperties().stringPropertyNames()){
            if (!ResourceXMLConstants.allPropSet.contains(key)) {
                //test attribute name is a valid XML attribute name
                if (isValidName(key)) {
                    ent.addAttribute(key, entity.getProperties().getProperty(key));
                } else {
                    //add sub element
                    final Element atelm = ent.addElement(ATTRIBUTE_TAG);
                    atelm.addAttribute(ATTRIBUTE_NAME_ATTR, key);
                    atelm.addAttribute(ATTRIBUTE_VALUE_ATTR, entity.getProperties().getProperty(key));
                }
            }
        }

    }
283544
protected <T> String resolveApitraryEntity(T entity) {
		String entityName = ClassUtil.getClassAnnotationValue(entity.getClass(), Entity.class, "value", String.class);
		if (entityName == null || entityName.isEmpty()) {
			entityName = StringUtil.toVerb(entity.getClass().getSimpleName());
		}
		return entityName;
	}
1102131
private void fillNode(final ResourceXMLParser.Entity entity, final NodeEntryImpl node) {
        node.setUsername(entity.getProperty(NODE_USERNAME));
        node.setHostname(entity.getProperty(NODE_HOSTNAME));
        node.setOsArch(entity.getProperty(NODE_OS_ARCH));
        node.setOsFamily(entity.getProperty(NODE_OS_FAMILY));
        node.setOsName(entity.getProperty(NODE_OS_NAME));
        node.setOsVersion(entity.getProperty(NODE_OS_VERSION));
        node.setDescription(entity.getProperty(COMMON_DESCRIPTION));
        final String tags = entity.getProperty(COMMON_TAGS);
        final HashSet<String> tags1;
        if (null != tags && !"".equals(tags)) {
            tags1 = new HashSet<String>();
            for (final String s : tags.split(",")) {
                tags1.add(s.trim());
            }
        } else {
            tags1 = new HashSet<String>();
        }
        node.setTags(tags1);

        if (null == node.getAttributes()) {
            node.setAttributes(new HashMap<String, String>());
        }
        if (null != entity.getProperties()) {
            for (String key : entity.getProperties().stringPropertyNames()) {
                if (!ResourceXMLConstants.allPropSet.contains(key)) {
                    node.getAttributes().put(key, entity.getProperty(key));
                }
            }

        }
        //parse embedded attribute elements
    }
1155430
static void validateDeferredIdAllocation(Object entity) {
    IdentifierMetadata identifierMetadata = EntityIntrospector.getIdentifierMetadata(entity);
    if (identifierMetadata.getDataType() == DataType.STRING) {
      throw new EntityManagerException(
          "Deferred ID allocation is not applicable for entities with String identifiers. ");
    }

  }
6518
public Entity wrap(Entity entity){
		if(null == entity) {
			return null;
		}
		
		final Entity wrapedEntity = new Entity();
		
		//wrap table name
		wrapedEntity.setTableName(wrap(entity.getTableName()));
		
		//wrap fields
		for (Entry<String, Object> entry : entity.entrySet()) {
			wrapedEntity.set(wrap(entry.getKey()), entry.getValue());
		}
		
		return wrapedEntity;
	}
724691
void nameSpaceChanged()
    {
        if ( nameSourceListeners == null )
            return;

        for(int i=0; i<nameSourceListeners.size(); i++)
            ((NameSource.Listener)(nameSourceListeners.get(i)))
                .nameSourceChanged( this );
    }
159416
public void setName(NameExpr name) {
        if (this.name != null) {
            updateReferences(this.name);
        }
        this.name = name;
        setAsParentNodeOf(name);
    }
862524
public void setEngineName(String name) {
        if (HTTL_DEFAULT.equals(name)) {
            name = "";
        } else {
            if (name.startsWith(HTTL_PREFIX)) {
                name = name.substring(HTTL_PREFIX.length());
            }
            if (name.endsWith(PROPERTIES_SUFFIX)) {
                name = name.substring(0, name.length() - PROPERTIES_SUFFIX.length());
            }
        }
        this.engineName = name;
    }
853555
private void processEntity(Entity entity, double latitude, double longitude) {
        // Only add entities that fall within the bounding box (if set)
        BoundingBox bb = this.configuration.getBboxConfiguration();
        if (bb != null && !bb.contains(latitude, longitude)) {
            return;
        }

        // Only add entities that have data
        if (entity.getTags().isEmpty()) {
            return;
        }

        // Only add named entities (if set)
        if (this.configuration.isNames()) {
            String name = getTagValue(entity.getTags(), "name");
            if (name == null || name.isEmpty()) {
                return;
            }
        }

        // Process entity
        Map<String, String> tagMap = new TreeMap<>();
        Set<PoiCategory> categories = new HashSet<>();
        for (Tag tag : entity.getTags()) {
            String key = tag.getKey().toLowerCase(Locale.ENGLISH);
            if (this.tagMappingResolver.getMappingTags().contains(key)) {
                // Check if there is a POI category for this tag and add POI to DB
                String tagStr = key + "=" + tag.getValue();
                try {
                    // Get categories from tag
                    List<PoiCategory> pcs = this.tagMappingResolver.getCategoriesFromTag(tagStr);

                    // Get categories from key, if tag wasn't matched
                    // Note: key categories should be parents of their value categories
                    if (pcs == null) {
                        pcs = this.tagMappingResolver.getCategoriesFromTag(key);
                    }

                    if (pcs != null) {
                        for (PoiCategory pc : pcs) {
                            // Add entity if its category matches
                            if (this.categoryFilter.isAcceptedCategory(pc)) {
                                // Collect the POI tags in a sorted manner (once)
                                if (tagMap.isEmpty()) {
                                    for (Tag t : entity.getTags()) {
                                        tagMap.put(t.getKey().toLowerCase(Locale.ENGLISH), t.getValue());
                                    }
                                }
                                categories.add(pc);
                            }
                        }
                    }
                } catch (UnknownPoiCategoryException e) {
                    LOGGER.warning("The '" + tagStr + "' tag refers to a POI that does not exist: " + e.getMessage());
                }
            }
        }

        // Store POI
        if (!tagMap.isEmpty()) {
            writePOI(this.poiAdded++, latitude, longitude, tagMap, categories);
        }
    }
640967
private void validateEntity(final DbEntity entity) throws DatabaseEngineException {
        if (entity.getName() == null || entity.getName().length() == 0) {
            throw new DatabaseEngineException("You have to define the entity name");
        }

        final int maxIdentSize = properties.getMaxIdentifierSize();
        if (entity.getName().length() > maxIdentSize) {
            throw new DatabaseEngineException(String.format("Entity '%s' exceeds the maximum number of characters (%d)", entity.getName(), maxIdentSize));
        }

        if (entity.getColumns().isEmpty()) {
            throw new DatabaseEngineException("You have to specify at least one column");
        }

        int numberOfAutoIncs = 0;
        for (DbColumn c : entity.getColumns()) {
            if (c.getName() == null || c.getName().length() == 0) {
                throw new DatabaseEngineException(String.format("Column in entity '%s' must have a name", entity.getName()));
            }

            if (c.getName().length() > maxIdentSize) {
                throw new DatabaseEngineException(String.format("Column '%s' in entity '%s' exceeds the maximum number of characters (%d)", c.getName(), entity.getName(), maxIdentSize));
            }

            if (c.isAutoInc()) {
                numberOfAutoIncs++;
            }
        }

        if (numberOfAutoIncs > 1) {
            throw new DatabaseEngineException("You can only define one auto incremented column");
        }

        // Index validation

        List<DbIndex> indexes = entity.getIndexes();
        if (!indexes.isEmpty()) {
            for (DbIndex index : indexes) {
                if (index.getColumns().isEmpty()) {
                    throw new DatabaseEngineException(String.format("You have to specify at least one column to create an index in entity '%s'", entity.getName()));
                }

                for (String column : index.getColumns()) {
                    if (column == null || column.length() == 0) {
                        throw new DatabaseEngineException(String.format("Column indexes must have a name in entity '%s'", entity.getName()));
                    }
                }
            }
        }

        // FK validation

        List<DbFk> fks = entity.getFks();
        if (!fks.isEmpty()) {
            for (DbFk fk : fks) {
                if (fk.getForeignTable() == null || fk.getForeignTable().length() == 0) {
                    throw new DatabaseEngineException(String.format("You have to specify the table when creating a Foreign Key in entity '%s'", entity.getName()));
                }

                if (fk.getLocalColumns().isEmpty()) {
                    throw new DatabaseEngineException(String.format("You must specify at least one local column when defining a Foreign Key in '%s'", entity.getName()));
                }

                if (fk.getForeignColumns().isEmpty()) {
                    throw new DatabaseEngineException(String.format("You must specify at least one foreign column when defining a Foreign Key in '%s'", entity.getName()));
                }

                if (fk.getLocalColumns().size() != fk.getForeignColumns().size()) {
                    throw new DatabaseEngineException(String.format("Number of local columns does not match foreign ones in entity '%s'", entity.getName()));
                }
            }
        }
    }
1255695
public void setNamedBindings(Map<String, Object> namedBindings) {
    if (namedBindings == null) {
      throw new IllegalArgumentException("namedBindings cannot be null");
    }
    this.namedBindings = namedBindings;
  }
315744
public void setEntities(java.util.Collection<InventoryResultEntity> entities) {
        if (entities == null) {
            this.entities = null;
            return;
        }

        this.entities = new com.amazonaws.internal.SdkInternalList<InventoryResultEntity>(entities);
    }
1168636
public void populate(Entity entity) {
    // auto date
    generateAutoDateOrDateTime(singletonList(entity), entity.getEntityType().getAttributes());

    // auto id
    Attribute idAttr = entity.getEntityType().getIdAttribute();
    if (idAttr != null
        && idAttr.isAuto()
        && entity.getIdValue() == null
        && (idAttr.getDataType() == STRING)) {
      entity.set(idAttr.getName(), idGenerator.generateId());
    }
  }
927016
@Override
    public void configure()
    {
        log.debug("Loading Entity Metadata...");
        ApplicationMetadata appMetadata = kunderaMetadata.getApplicationMetadata();

        for (String persistenceUnit : persistenceUnits)
        {
            if (appMetadata.getMetamodelMap().get(persistenceUnit.trim()) != null)
            {
                if (log.isDebugEnabled())
                {
                    log.debug("Metadata already exists for the Persistence Unit " + persistenceUnit + ". Nothing to do");
                }
            }
            else
            {
                loadEntityMetadata(persistenceUnit);
            }
        }
    }