All Downloads are FREE. Search and download functionalities are using the official Maven repository.

online.sanen.unabo.nosql.mongodb.SimpleDataInfomation Maven / Gradle / Ivy

The newest version!
package online.sanen.unabo.nosql.mongodb;

import java.util.List;

import online.sanen.unabo.nosql.DataInfomation;
import online.sanen.unabo.nosql.Manager;
import org.bson.Document;

/**
 * 
 * @author lazyToShow 
* Date: 2021年9月19日
* Time: 下午12:15:19
*/ public class SimpleDataInfomation implements DataInfomation { private Manager manager; public SimpleDataInfomation(Manager manager) { this.manager = manager; } @Override public List databaseNames() { return manager.getTemplate().getDatabaseNames(); } @Override public List tablesNames(String schema) { return manager.getTemplate().getTableNames(schema); } @Override public List tableStatus(String schema) { return manager.getTemplate().tableStatus(schema); } @Override public List views(String schema) { return manager.getTemplate().getViews(schema); } @Override public List viewStatus(String schema) { List documents = manager.getTemplate().viewStatus(schema); return documents; } @Override public boolean isTableExist(String schema, String table) { return manager.getTemplate().getTableNames(schema).stream().anyMatch(match->match.equals(table)); } @Override public boolean isViewExist(String schema, String table) { return manager.getTemplate().getViews(schema).stream().anyMatch(match->match.equals(table)); } @Override public List columns(String schema, String table) { return manager.getTemplate().getColumns(schema,table); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy