private void checkMultipleLobs(TableInfo tableInfo) { if (tableInfo.getLobColumnInfo().size() > 1) throw new KunderaException("Multiple Lob fields in a single Entity are not supported in Kundera"); }
/** * @param tableInfo * @return */ private DBObject setCollectionProperties(TableInfo tableInfo) { boolean isCappedCollection = isCappedCollection(tableInfo); DBObject options = new BasicDBObject(); if ((tableInfo.getLobColumnInfo().isEmpty() || tableInfo.getLobColumnInfo() == null) && isCappedCollection) { int collectionSize = MongoDBPropertyReader.msmd != null ? MongoDBPropertyReader.msmd.getCollectionSize( databaseName, tableInfo.getTableName()) : 100000; int max = MongoDBPropertyReader.msmd != null ? MongoDBPropertyReader.msmd.getMaxSize(databaseName, tableInfo.getTableName()) : 100; options.put(MongoDBConstants.CAPPED, isCappedCollection); options.put(MongoDBConstants.SIZE, collectionSize); options.put(MongoDBConstants.MAX, max); } return options; }
/** * drop schema method drop the table */ public void dropSchema() { if (operation != null && operation.equalsIgnoreCase("create-drop")) { for (TableInfo tableInfo : tableInfos) { if (tableInfo.getLobColumnInfo().isEmpty()) { coll = db.getCollection(tableInfo.getTableName()); coll.drop(); KunderaCoreUtils.printQuery("Drop collection:" + tableInfo.getTableName(), showQuery); } else { coll = db.getCollection(tableInfo.getTableName() + MongoDBUtils.FILES); coll.drop(); KunderaCoreUtils.printQuery("Drop collection:" + tableInfo.getTableName() + MongoDBUtils.FILES, showQuery); coll = db.getCollection(tableInfo.getTableName() + MongoDBUtils.CHUNKS); coll.drop(); KunderaCoreUtils.printQuery("Drop collection:" + tableInfo.getTableName() + MongoDBUtils.CHUNKS, showQuery); } } } db = null; }
if (tableInfo.getLobColumnInfo().isEmpty())
private void checkMultipleLobs(TableInfo tableInfo) { if (tableInfo.getLobColumnInfo().size() > 1) throw new KunderaException("Multiple Lob fields in a single Entity are not supported in Kundera"); }
DB db = mongo.getDB(databaseName); DBCollection collection = null; if (tableInfo.getLobColumnInfo().isEmpty())
DB db = mongo.getDB(databaseName); if (tableInfo.getLobColumnInfo().isEmpty())
/** * @param tableInfo * @return */ private DBObject setCollectionProperties(TableInfo tableInfo) { boolean isCappedCollection = isCappedCollection(tableInfo); DBObject options = new BasicDBObject(); if ((tableInfo.getLobColumnInfo().isEmpty() || tableInfo.getLobColumnInfo() == null) && isCappedCollection) { int collectionSize = MongoDBPropertyReader.msmd != null ? MongoDBPropertyReader.msmd.getCollectionSize( databaseName, tableInfo.getTableName()) : 100000; int max = MongoDBPropertyReader.msmd != null ? MongoDBPropertyReader.msmd.getMaxSize(databaseName, tableInfo.getTableName()) : 100; options.put(MongoDBConstants.CAPPED, isCappedCollection); options.put(MongoDBConstants.SIZE, collectionSize); options.put(MongoDBConstants.MAX, max); } return options; }
/** * drop schema method drop the table */ public void dropSchema() { if (operation != null && operation.equalsIgnoreCase("create-drop")) { for (TableInfo tableInfo : tableInfos) { if (tableInfo.getLobColumnInfo().isEmpty()) { coll = db.getCollection(tableInfo.getTableName()); coll.drop(); KunderaCoreUtils.printQuery("Drop collection:" + tableInfo.getTableName(), showQuery); } else { coll = db.getCollection(tableInfo.getTableName() + MongoDBUtils.FILES); coll.drop(); KunderaCoreUtils.printQuery("Drop collection:" + tableInfo.getTableName() + MongoDBUtils.FILES, showQuery); coll = db.getCollection(tableInfo.getTableName() + MongoDBUtils.CHUNKS); coll.drop(); KunderaCoreUtils.printQuery("Drop collection:" + tableInfo.getTableName() + MongoDBUtils.CHUNKS, showQuery); } } } db = null; }
if (tableInfo.getLobColumnInfo().isEmpty())
DB db = mongo.getDB(databaseName); DBCollection collection = null; if (tableInfo.getLobColumnInfo().isEmpty())
DB db = mongo.getDB(databaseName); if (tableInfo.getLobColumnInfo().isEmpty())