Package com.impetus.kundera.configure.schema

Examples of com.impetus.kundera.configure.schema.SchemaGenerationException


    @Test
    public void testSchemaGenerationException()
    {

        SchemaGenerationException exception = new SchemaGenerationException("Error with string");
        Assert.assertNotNull(exception);
       
        exception = new SchemaGenerationException(new RuntimeException());
        Assert.assertNotNull(exception);

   
        exception = new SchemaGenerationException(new RuntimeException(),"KunderaTests");
        Assert.assertNotNull(exception);

        exception = new SchemaGenerationException(new RuntimeException(),"KunderaTests","test");
        Assert.assertNotNull(exception);

        exception = new SchemaGenerationException(new RuntimeException(),"KunderaTests","test");
        Assert.assertNotNull(exception);

        exception = new SchemaGenerationException("error with string ",new RuntimeException(),"KunderaTests","test");
        Assert.assertNotNull(exception);
       
        exception = new SchemaGenerationException("error with string ", "cassandra", "KunderaTests","test");
        Assert.assertNotNull(exception);

        exception = new SchemaGenerationException("error with string ","KunderaTests","test");
        Assert.assertNotNull(exception);

        exception = new SchemaGenerationException("error with string ",new RuntimeException(),"KunderaTests");
        Assert.assertNotNull(exception);
    }
View Full Code Here


        db = mongo.getDB(databaseName);
        if (db == null)
        {

            logger.error("Database " + databaseName + "does not exist");
            throw new SchemaGenerationException("database " + databaseName + "does not exist", "mongoDb", databaseName);
        }
        else
        {
            for (TableInfo tableInfo : tableInfos)
            {
                if (!db.collectionExists(tableInfo.getTableName()))
                {
                    logger.error("Collection " + tableInfo.getTableName() + "does not exist in db " + db.getName());
                    throw new SchemaGenerationException("Collection " + tableInfo.getTableName()
                            + " does not exist in db " + db.getName(), "mongoDb", databaseName,
                            tableInfo.getTableName());
                }
            }
        }
View Full Code Here

                {
                    MongoDBUtils.authenticate(puMetadata.getProperties(), externalProperties, db);
                }
                catch (ClientLoaderException e)
                {
                    throw new SchemaGenerationException(e);
                }
                catch (KunderaAuthenticationException e)
                {
                    throw new SchemaGenerationException(e);
                }

                return true;
            }
            catch (UnknownHostException e)
            {
                message = e.getMessage();
                logger.error("Database host cannot be resolved, Caused by", e);
            }
        }
        throw new SchemaGenerationException("Database host cannot be resolved, Caused by" + message);
    }
View Full Code Here

                EntityMetadata targetEntityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
                        entityClass);
                if (targetEntityMetadata == null)
                {
                    log.error("Persistence unit for class : " + entityClass + " is not loaded");
                    throw new SchemaGenerationException("Persistence unit for class : " + entityClass
                            + " is not loaded");
                }
                ForeignKey relationType = relation.getType();

                // if relation type is one to many or join by primary key
View Full Code Here

                                        return Integer.parseInt(size);
                                    }
                                }
                                catch (NumberFormatException nfe)
                                {
                                    throw new SchemaGenerationException(nfe);
                                }
                            }
                        }
                    }
                }
View Full Code Here

                                        return Integer.parseInt(max);
                                    }
                                }
                                catch (NumberFormatException nfe)
                                {
                                    throw new SchemaGenerationException(nfe);
                                }
                            }
                        }
                    }
                }
View Full Code Here

            }
        }
        catch (Exception e)
        {
            logger.error("Error while creating database, caused by {}.", e);
            throw new SchemaGenerationException("Error while creating database", e, "couchDB");
        }
    }
View Full Code Here

    {
        try
        {
            if (!checkForDBExistence())
            {
                throw new SchemaGenerationException("Database " + databaseName + " not exist");
            }

            for (TableInfo tableInfo : tableInfos)
            {
                Map<String, MapReduce> views = new HashMap<String, MapReduce>();
                String id = CouchDBConstants.DESIGN + tableInfo.getTableName();
                CouchDBDesignDocument designDocument = getDesignDocument(id);
                designDocument.setLanguage(CouchDBConstants.LANGUAGE);
                views = designDocument.getViews();
                if (views == null)
                {
                    logger.warn("No view exist for table " + tableInfo.getTableName()
                            + "so any query will not produce any result");
                    return;
                }
                for (IndexInfo indexInfo : tableInfo.getColumnsToBeIndexed())
                {
                    if (views.get(indexInfo.getColumnName()) == null)
                    {
                        logger.warn("No view exist for column " + indexInfo.getColumnName() + " of table "
                                + tableInfo.getTableName() + "so any query on column " + indexInfo.getColumnName()
                                + "will not produce any result");
                    }
                }

                // for id column.
                if (views.get(tableInfo.getIdColumnName()) == null)
                {
                    logger.warn("No view exist for id column " + tableInfo.getIdColumnName() + " of table "
                            + tableInfo.getTableName() + "so any query on id column " + tableInfo.getIdColumnName()
                            + "will not produce any result");
                }

                // for select all.
                if (views.get("all") == null)
                {
                    logger.warn("No view exist for select all for table " + tableInfo.getTableName()
                            + "so select all query will not produce any result");
                }
            }
        }
        catch (Exception e)
        {
            throw new SchemaGenerationException("Database " + databaseName + " not exist");
        }
    }
View Full Code Here

            }
        }
        catch (Exception e)
        {
            logger.error("Error while creating database, caused by {}.", e);
            throw new SchemaGenerationException("Error while creating database", e, "couchDB");
        }
    }
View Full Code Here

            }
        }
        catch (Exception e)
        {
            logger.error("Error while creating database {} , caused by {}.", databaseName, e);
            throw new SchemaGenerationException("Error while creating database", e, "couchDB");
        }
    }
View Full Code Here

TOP

Related Classes of com.impetus.kundera.configure.schema.SchemaGenerationException

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.