com.mongodb.jdbc.MongoResultDoc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mongodb-jdbc Show documentation
Show all versions of mongodb-jdbc Show documentation
JDBC Driver for MongoDB Atlas SQL interface
package com.mongodb.jdbc;
import java.sql.SQLException;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class MongoResultDoc {
public Boolean emptyResultSet;
public List values;
public MongoResultDoc() {}
public MongoResultDoc(List cols, boolean isEmpty) {
values = cols;
this.emptyResultSet = isEmpty;
}
List getValues() {
return values;
}
boolean isEmpty() {
return emptyResultSet != null && emptyResultSet;
}
// MongoResultDoc[emptyResultSet=,values=[Column{database=, table=, tableAlias=, column=, columnAlias=, value=}]]
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}
public int columnCount() throws SQLException {
if (values == null) {
throw new SQLException("Invalid input");
}
return values.size();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy