Package com.impetus.kundera.persistence.EntityManagerFactoryImpl

Examples of com.impetus.kundera.persistence.EntityManagerFactoryImpl.KunderaMetadata


        if (!m.isAccessible())
        {
            m.setAccessible(true);
        }

        KunderaMetadata kunderaMetadata = ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance();
        m.invoke(ds, kunderaMetadata);

        m = GenericClientFactory.class.getDeclaredMethod("setPersistenceUnit", String.class);
        if (!m.isAccessible())
        {
View Full Code Here


     * @param relation
     */
    public void setProxyRelationObject(Object entity, Map<String, Object> relationsMap, EntityMetadata m,
            PersistenceDelegator pd, Object entityId, Relation relation)
    {
        KunderaMetadata kunderaMetadata = pd.getKunderaMetadata();
        String relationName = MetadataUtils.getMappedName(m, relation, kunderaMetadata);
        Object relationValue = relationsMap != null ? relationsMap.get(relationName) : null;

        if ((relation.getType().equals(ForeignKey.ONE_TO_ONE) || relation.getType().equals(ForeignKey.MANY_TO_ONE)))
        { // One-To-One or Many-To-One relationship

            Field biDirectionalField = relation.getBiDirectionalField();
            boolean isBidirectionalRelation = (biDirectionalField != null);
            if (isBidirectionalRelation && (relationValue == null && !relation.isJoinedByPrimaryKey()))
            {
                EntityMetadata parentEntityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
                        relation.getTargetEntity());
                Object owner = null;

                String entityName = m.getEntityClazz().getName() + "_" + entityId + "#"
                        + relation.getProperty().getName();

                KunderaProxy kp = kunderaMetadata.getCoreMetadata().getLazyInitializerFactory().getProxy(entityName);

                if (kp != null)
                {
                    owner = kp.getKunderaLazyInitializer().getOwner();
                    if (owner != null && owner.getClass().equals(parentEntityMetadata.getEntityClazz()))
View Full Code Here

        }
       
        getpd.setAccessible(true);
        PersistenceDelegator pd = getPersistenceDelegator(em, getpd);

        KunderaMetadata kunderaMetadata = ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance();

        CassQuery query = new CassQuery(kunderaQuery, pd, kunderaMetadata);
        query.setMaxResults(maxResult);

        EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass);
View Full Code Here

          log.warn(e.getMessage());
        }
        getpd.setAccessible(true);
//        PersistenceDelegator pd = null;
        PersistenceDelegator pd = getPersistenceDelegator(em, getpd);
        KunderaMetadata kunderaMetadata = ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance();

        CassQuery query = new CassQuery(kunderaQuery, pd, kunderaMetadata);
        query.setMaxResults(maxResult);
        if(ttl != null)
        {
View Full Code Here

        catch (InvocationTargetException e)
        {
          log.warn(e.getMessage());
        }

        KunderaMetadata kunderaMetadata = ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance();

        CassQuery query = new CassQuery(kunderaQuery, pd, kunderaMetadata);
        query.setMaxResults(maxResult);

        String cqlQuery = query.createDeleteQuery(kunderaQuery);
View Full Code Here

        {
          log.warn(e.getMessage());
        }
        getpostParsingInit.setAccessible(true);

        KunderaMetadata kunderaMetadata = ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance();
        KunderaQuery kunderaQuery = new KunderaQuery(queryString, kunderaMetadata);
        KunderaQueryParser queryParser = new KunderaQueryParser(kunderaQuery);
        queryParser.parse();
        try
        {
View Full Code Here

    } catch (NoSuchMethodException e) {
      logger.warn(e.getMessage());
    }
    getpostParsingInit.setAccessible(true);

    KunderaMetadata kunderaMetadata = ((EntityManagerFactoryImpl) emf)
        .getKunderaMetadataInstance();
    KunderaQuery kunderaQuery = new KunderaQuery(queryString,
        kunderaMetadata);
    KunderaQueryParser queryParser = new KunderaQueryParser(kunderaQuery);
    queryParser.parse();
View Full Code Here

      logger.warn(e.getMessage());
    } catch (InvocationTargetException e) {
      logger.warn(e.getMessage());
    }

    KunderaMetadata kunderaMetadata = ((EntityManagerFactoryImpl) emf)
        .getKunderaMetadataInstance();

    CassQuery query = new CassQuery(kunderaQuery, pd, kunderaMetadata);
    query.setMaxResults(maxResult);
View Full Code Here

     * @param _PU1
     */
    private void checkEMFPropertyAfterClosing(String _PU1, EntityManagerFactory emf)
    {
        Assert.assertFalse(emf.isOpen());
        KunderaMetadata kunderaMetadata = ((EntityManagerFactoryImpl)emf).getKunderaMetadataInstance();
        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(_PU1));
        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadataMap().get(_PU1));
//        Assert.assertNull(kunderaMetadata.getClientMetadata(_PU1));
        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getMetamodelMap().get(_PU1));
        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getMetamodel(_PU1));
        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getMetaModelBuilder(_PU1));
//        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getSchemaMetadata().getPuToSchemaMetadata()
//                .get(_PU1));
    }
View Full Code Here

    private void checkEMFPropertiesAfterCreating(String pu, EntityManagerFactory emf)
    {
        Assert.assertTrue(emf.isOpen());
        EntityManager em = emf.createEntityManager();
        Assert.assertNotNull(em);
        KunderaMetadata kunderaMetadata = ((EntityManagerFactoryImpl)emf).getKunderaMetadataInstance();
        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(pu));
        Assert.assertFalse(kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadataMap().isEmpty());
        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadataMap().get(pu));
//        Assert.assertNotNull(kunderaMetadata.getClientMetadata(pu));
        Assert.assertFalse(kunderaMetadata.getApplicationMetadata().getMetamodelMap().isEmpty());
        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getMetamodelMap().get(pu));
        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getMetamodel(pu));
        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getMetaModelBuilder(pu));
        // TODO: Devise better way.
//        Assert.assertNotNull(kunderaMetadata.getApplicationMetadata().getSchemaMetadata()
//                .getPuToSchemaMetadata().get(pu));
//        Assert.assertNull(kunderaMetadata.getClientMetadata(pu).getLuceneIndexDir());
    }
View Full Code Here

TOP

Related Classes of com.impetus.kundera.persistence.EntityManagerFactoryImpl.KunderaMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.