Package com.impetus.kundera.metadata.model

Examples of com.impetus.kundera.metadata.model.PersistenceUnitMetadata


    private void applyMetadataChanges(EntityMetadata metadata)
    {
//        log.debug("In apply changes class is " + metadata.getEntityClazz().getName());
//        log.debug("In apply changes pu is " + persistenceUnit);
        metadata.setPersistenceUnit(persistenceUnit);
        PersistenceUnitMetadata puMetadata = kunderaMetadata.getApplicationMetadata()
                .getPersistenceUnitMetadata(persistenceUnit);
       
        String keyspace = puProperties != null ? (String) puProperties.get(PersistenceProperties.KUNDERA_KEYSPACE):null;
       
        keyspace = keyspace == null ? puMetadata.getProperty(PersistenceProperties.KUNDERA_KEYSPACE):keyspace;

        // precedence to @Table annotation.
        if (metadata.getSchema() == null)
        {
            metadata.setSchema(keyspace);
View Full Code Here


    }

    private void setBatchSize(String persistenceUnit, Map<String, Object> puProperties) {
        String batch_Size = null;

        PersistenceUnitMetadata puMetadata =
            KunderaMetadataManager.getPersistenceUnitMetadata(kunderaMetadata, persistenceUnit);

        String externalBatchSize =
            puProperties != null ? (String) puProperties.get(PersistenceProperties.KUNDERA_BATCH_SIZE) : null;

        Integer intbatch = null;
        if (puMetadata.getBatchSize() > 0) {
            intbatch = new Integer(puMetadata.getBatchSize());
        }
        batch_Size =
            (String) (externalBatchSize != null ? externalBatchSize : intbatch != null ? intbatch.toString() : null);

        setBatchSize(batch_Size);
View Full Code Here

    protected Object createPoolOrConnection()
    {
        if (log.isInfoEnabled())
            log.info("Initializing Neo4J database connection...");

        PersistenceUnitMetadata puMetadata = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(
                getPersistenceUnit());

        Properties props = puMetadata.getProperties();
       
        String datastoreFilePath = null;
        if (externalProperties != null)
        {
            datastoreFilePath = (String) externalProperties.get(PersistenceProperties.KUNDERA_DATASTORE_FILE_PATH);
View Full Code Here

     * @throws java.lang.Exception
     */
    @After
    public void tearDown() throws Exception
    {
        PersistenceUnitMetadata puMetadata = KunderaMetadataManager
                .getPersistenceUnitMetadata(kunderaMetadata, IMDB_PU);
        String datastoreFilePath = puMetadata.getProperty(PersistenceProperties.KUNDERA_DATASTORE_FILE_PATH);
        emf.close();
        if (datastoreFilePath != null)
        {
            FileUtils.deleteRecursively(new File(datastoreFilePath));
        }
View Full Code Here

        return value == null ? null : new String(value, Charset.forName(Constants.CHARSET_UTF8));
    }

    public static String getKeyspace(final KunderaMetadata kunderaMetadata, String persistenceUnit)
    {
        PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata()
                .getPersistenceUnitMetadata(persistenceUnit);
        Properties props = persistenceUnitMetadata.getProperties();
        String keyspace = (String) props.get(PersistenceProperties.KUNDERA_KEYSPACE);
        return keyspace;
    }
View Full Code Here

    public static String getIdColumnName(final KunderaMetadata kunderaMetadata, final EntityMetadata m,
            final Map<String, Object> externalProperties, final boolean isCql3Enabled)
    {
        // key for auto schema generation.
        String persistenceUnit = m.getPersistenceUnit();
        PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata()
                .getPersistenceUnitMetadata(persistenceUnit);
        String autoDdlOption = externalProperties != null ? (String) externalProperties
                .get(PersistenceProperties.KUNDERA_DDL_AUTO_PREPARE) : null;
        if (autoDdlOption == null)
        {
            autoDdlOption = persistenceUnitMetadata != null ? persistenceUnitMetadata
                    .getProperty(PersistenceProperties.KUNDERA_DDL_AUTO_PREPARE) : null;
        }

        boolean containsBasicCollectionField = MetadataUtils.containsBasicElementCollectionField(m, kunderaMetadata);
View Full Code Here

     * @throws java.lang.Exception
     */
    @After
    public void tearDown() throws Exception
    {
        PersistenceUnitMetadata puMetadata = KunderaMetadataManager.getPersistenceUnitMetadata(((EntityManagerFactoryImpl)emf).getKunderaMetadataInstance(), IMDB_BATCH_PU);
        String datastoreFilePath = puMetadata.getProperty(PersistenceProperties.KUNDERA_DATASTORE_FILE_PATH);

        em.close();
       
        emf.close();

View Full Code Here

    public void initialize(Map<String, Object> externalProperty)
    {
        setExternalProperties(externalProperty);
        initializePropertyReader();
        // Initialize HBase configuration
        PersistenceUnitMetadata puMetadata = KunderaMetadataManager.getPersistenceUnitMetadata(kunderaMetadata, getPersistenceUnit());

        String node = null;
        String port = null;
        String poolSize = null;
        if (externalProperty != null)
        {
            node = (String) externalProperty.get(PersistenceProperties.KUNDERA_NODES);
            port = (String) externalProperty.get(PersistenceProperties.KUNDERA_PORT);
            poolSize = (String) externalProperty.get(PersistenceProperties.KUNDERA_POOL_SIZE_MAX_ACTIVE);
        }
        if (node == null)
        {
            node = puMetadata.getProperties().getProperty(PersistenceProperties.KUNDERA_NODES);
        }
        if (port == null)
        {
            port = puMetadata.getProperties().getProperty(PersistenceProperties.KUNDERA_PORT);
        }
        if (poolSize == null)
        {
            poolSize = puMetadata.getProperties().getProperty(PersistenceProperties.KUNDERA_POOL_SIZE_MAX_ACTIVE);
        }

        if (StringUtils.isEmpty(poolSize))
        {
            this.poolSize = DEFAULT_POOL_SIZE;
View Full Code Here

        String batch_Size =
            puProperties != null ? (String) puProperties.get(PersistenceProperties.KUNDERA_BATCH_SIZE) : null;
        if (batch_Size != null) {
            setBatchSize(Integer.valueOf(batch_Size));
        } else {
            PersistenceUnitMetadata puMetadata =
                KunderaMetadataManager.getPersistenceUnitMetadata(kunderaMetadata, persistenceUnit);
            setBatchSize(puMetadata.getBatchSize());
        }
    }
View Full Code Here

     * @throws java.lang.Exception
     */
    @After
    public void tearDown() throws Exception
    {
        PersistenceUnitMetadata puMetadata = KunderaMetadataManager.getPersistenceUnitMetadata(((EntityManagerFactoryImpl)emf).getKunderaMetadataInstance(), IMDB_PU);
        String datastoreFilePath = puMetadata.getProperty(PersistenceProperties.KUNDERA_DATASTORE_FILE_PATH);

        em.close();
        emf.close();

        if (datastoreFilePath != null)
View Full Code Here

TOP

Related Classes of com.impetus.kundera.metadata.model.PersistenceUnitMetadata

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.