Gets the metadata from GFS entity.

@param gfs
the gfs
@param m
the m
@param entity
the entity
@param kunderaMetadata
the kundera metadata
@return the metadata from GFS entity
335820
public DBObject getMetadataFromGFSEntity(GridFS gfs, EntityMetadata m, Object entity,
            KunderaMetadata kunderaMetadata)
    {
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
                .getMetamodel(m.getPersistenceUnit());

        EntityType entityType = metaModel.entity(m.getEntityClazz());

        DBObject gfsMetadata = new BasicDBObject();
        Set<Attribute> columns = entityType.getAttributes();
        for (Attribute column : columns)
        {
            boolean isLob = ((Field) column.getJavaMember()).getAnnotation(Lob.class) != null;
            if (!isLob)
            {
                DocumentObjectMapper.extractFieldValue(entity, gfsMetadata, column);
            }
        }
        return gfsMetadata;
    }
637513
@Override
    final public ManagedConnectionMetaData getMetaData()
                    throws ResourceException {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "getMetaData");
        }

        if (_metaData == null) {
            _metaData = new JmsJcaManagedConnectionMetaData();
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "getMetaData", _metaData);
        }
        return _metaData;

    }
597352
@Override
    public ManagedConnectionMetaData getMetaData() throws ResourceException {
        try {
            return new JcrManagedConnectionMetaData(mcf.getRepository(), session);
        } catch (Exception e) {
            throw new ResourceException(e);
        }
    }
1294035
public Object getEntityFromGFSDBFile(Class<?> entityClazz, Object entity, EntityMetadata m, GridFSDBFile outputFile,
            KunderaMetadata kunderaMetadata)
    {
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
                .getMetamodel(m.getPersistenceUnit());
        String id = ((AbstractAttribute) m.getIdAttribute()).getJPAColumnName();
        Object rowKey = ((DBObject) outputFile.get(MongoDBUtils.METADATA)).get(id);
        Class<?> rowKeyValueClass = rowKey.getClass();
        Class<?> idClass = m.getIdAttribute().getJavaType();
        rowKey = MongoDBUtils.populateValue(rowKey, idClass);
        rowKey = MongoDBUtils.getTranslatedObject(rowKey, rowKeyValueClass, idClass);
        PropertyAccessorHelper.setId(entity, m, rowKey);
        EntityType entityType = metaModel.entity(entityClazz);

        Set<Attribute> columns = entityType.getAttributes();
        for (Attribute column : columns)
        {
            boolean isLob = ((Field) column.getJavaMember()).getAnnotation(Lob.class) != null;
            if (isLob)
            {
                if (column.getJavaType().isAssignableFrom(byte[].class))
                {
                    InputStream is = outputFile.getInputStream();
                    try
                    {
                        PropertyAccessorHelper.set(entity, (Field) column.getJavaMember(), ByteStreams.toByteArray(is));
                    }
                    catch (IOException e)
                    {
                        log.error("Error while converting inputstream from GridFSDBFile to byte array, Caused by: ", e);
                        throw new KunderaException(
                                "Error while converting inputstream from GridFSDBFile to byte array, Caused by: ", e);
                    }
                }
            }
            else if (!column.equals(m.getIdAttribute()))
                DocumentObjectMapper.setFieldValue(outputFile, entity, column, true);
        }
        return entity;
    }
1036339
public static String getMessageMetadata(Msg msg, String property)
    {
        String data = null;
        Metadata metadata = msg.getMetadata();
        if (metadata != null) {
            data = metadata.get(property);
        }
        return data;
    }
954380
protected CFMetaData getCFMetaData(String ks, String cf, Cassandra.Client client)
            throws NotFoundException,
            InvalidRequestException,
            TException,
            org.apache.cassandra.exceptions.InvalidRequestException,
            ConfigurationException
    {
        KsDef ksDef = client.describe_keyspace(ks);
        for (CfDef cfDef : ksDef.cf_defs)
        {
            if (cfDef.name.equalsIgnoreCase(cf))
                return CFMetaData.fromThrift(cfDef);
        }
        return null;
    }
1104530
public Object getMetadata(ITree node, String key) {
        Object metadata;
        if (node == null || (metadata = node.getMetadata(key)) == null)
            return getMetadata(key);
        return metadata;
    }
1018334
private void returnMetadata(Buffer buffer) {
        Callback<SketchMetadata> callback = getFirstCallback(BeanMessageID.BL_GET_META);
        if (callback != null) {
            callback.onResult(SketchMetadata.fromPayload(buffer));
        }
    }
3832
public ConversationMetaData getMetaData()
   {
      if (tc.isEntryEnabled()) SibTr.entry(this, tc, "getMetaData");
      if (tc.isEntryEnabled()) SibTr.exit(this, tc, "getMetaData", metaData);      
      return metaData;   
   }
1205861
@Override
    protected List<Object> populateEntities(EntityMetadata m, Client client)
    {
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                m.getPersistenceUnit());
        EntityType entity = metaModel.entity(m.getEntityClazz());
        Expression whereExpression = KunderaQueryUtils.getWhereClause(kunderaQuery.getJpqlExpression());

        QueryBuilder filter = whereExpression == null || whereExpression instanceof NullExpression ? null
                : esFilterBuilder.populateFilterBuilder(((WhereClause) whereExpression).getConditionalExpression(), m);

        return ((ESClient) client).executeQuery(filter, buildAggregation(kunderaQuery, m, filter), m,
                getKunderaQuery(),this.firstResult, this.maxResult);
    }
1349753
public static JaxWsServerMetaData getJaxWsServerMetaData(ModuleMetaData mmd) {

        JaxWsServerMetaData serverMetaData = null;
        if (mmd != null) {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "Getting client metadata from module metadata instance: " + mmd);
            }

            JaxWsModuleMetaData moduleMetaData = (JaxWsModuleMetaData) mmd.getMetaData(jaxwsModuleSlot);
            if (moduleMetaData != null) {
                serverMetaData = moduleMetaData.getServerMetaData();
            }
        }

        return serverMetaData;
    }
1258730
@Override
    public MetaData getMetaData() throws CDIException {
        MetaData metaData = null;
        if (isModule()) {
            metaData = getModuleMetaData();
        } else {
            metaData = application.getApplicationMetaData();
        }
        return metaData;
    }
1148694
public <T> T getNodeMetaData(Object key) {
        if (metaDataMap == null) {
            return (T) null;
        }
        return (T) metaDataMap.get(key);
    }
963181
public com.google.api.ads.admanager.axis.v201902.VideoMetadata getMetadata() {
        return metadata;
    }
87711
private EntityMetadata getMetadata(Class<?> clazz)
    {
        EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, clazz);
        if (metadata == null)
        {
            log.error("Entity metadata not found for {}, possible reasons may be: "
                    + "1) not annotated with @Entity. 2) is annotated with @MappedSuperclass."
                    + "3) does not properly with mapped persistence unit for persistence unit and keyspace. Please verify with @Table annotation or persistence.xml "
                    + clazz);
            throw new KunderaException("Entity metadata not found for " + clazz.getName());
        }
        return metadata;
    }
447622
protected List findUsingLucene(EntityMetadata m, Client client) {
        MetamodelImpl metaModel =
            (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
        boolean useInvertedIndex = CassandraIndexHelper.isInvertedIndexingApplicable(m,
            MetadataUtils.useSecondryIndex(((ClientBase) client).getClientMetadata()));
        Map<Boolean, List<IndexClause>> ixClause = prepareIndexClause(m, useInvertedIndex);
        List<Object> result = new ArrayList<Object>();
        if (((CassandraClientBase) client).isCql3Enabled(m)) {
            result = ((CassandraClientBase) client).executeQuery(m.getEntityClazz(), m.getRelationNames(), false,
                onQueryOverCQL3(m, client, metaModel, m.getRelationNames()));
        } else {
            result = ((CassandraEntityReader) getReader()).handleFindByRange(m, client, result, ixClause, true,
                getColumnList(m, metaModel, getKunderaQuery().getResult(), null), isSingleResult ? 1 : this.maxResult);
        }
        return result;
    }
461445
public String getJoinColumnName(final KunderaMetadata kunderaMetadata)
    {
                
        if(joinColumnName == null && isJoinedByPrimaryKey)
        {
            EntityMetadata joinClassMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, targetEntity);
            joinColumnName  = ((AbstractAttribute)joinClassMetadata.getIdAttribute()).getJPAColumnName();
        }
        
        if(joinTableMetadata != null)
        {
            joinColumnName = joinTableMetadata.getJoinColumns() != null? joinTableMetadata.getJoinColumns().iterator().next():null;
        }
        
        if(isBiDirectional())
        {
            // Give precedence to join column name!
            if(biDirectionalField.isAnnotationPresent(JoinColumn.class))
            {
                joinColumnName = biDirectionalField.getAnnotation(JoinColumn.class).name();
            }
        }
        
        return joinColumnName !=null? joinColumnName:property.getName();
    }