Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did not compile with rust 1.4 stable and 1.41 nightly. … #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions src/java/sql/result_set_meta_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,90 +6,91 @@ use jvm;

jvm_object!(ResultSetMetaData, "java/sql/ResultSetMetaData");

pub trait IResultSetMetaData : IObject /* + IWrapper */ {
fn get_catalog_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
// pub trait IResultSetMetaData : IObject /* + IWrapper */ {
impl ResultSetMetaData {
pub fn get_catalog_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
return jvm_call!(string: self, "getCatalogName", "(I)Ljava/lang/String;", &[&column.to_value()]);
}

fn get_column_class_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
pub fn get_column_class_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
return jvm_call!(string: self, "getColumnClassName", "(I)Ljava/lang/String;", &[&column.to_value()]);
}

fn get_column_count(&self) -> java::Result<i32> {
pub fn get_column_count(&self) -> java::Result<i32> {
return jvm_call!(int: self, "getColumnCount", "()I", &[]);
}

fn get_column_display_size(&self, column: i32) -> java::Result<i32> {
pub fn get_column_display_size(&self, column: i32) -> java::Result<i32> {
return jvm_call!(int: self, "getColumnDisplaySize", "(I)I", &[&column.to_value()]);
}

fn get_column_label(&self, column: i32) -> java::Result<Option<std::string::String>> {
pub fn get_column_label(&self, column: i32) -> java::Result<Option<std::string::String>> {
return jvm_call!(string: self, "getColumnLabel", "(I)Ljava/lang/String;", &[&column.to_value()]);
}

fn get_column_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
pub fn get_column_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
return jvm_call!(string: self, "getColumnName", "(I)Ljava/lang/String;", &[&column.to_value()]);
}

fn get_column_type(&self, column: i32) -> java::Result<i32> {
pub fn get_column_type(&self, column: i32) -> java::Result<i32> {
return jvm_call!(int: self, "getColumnType", "(I)I", &[&column.to_value()]);
}

fn get_column_type_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
pub fn get_column_type_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
return jvm_call!(string: self, "getColumnTypeName", "(I)Ljava/lang/String;", &[&column.to_value()]);
}

fn get_precision(&self, column: i32) -> java::Result<i32> {
pub fn get_precision(&self, column: i32) -> java::Result<i32> {
return jvm_call!(int: self, "getPrecision", "(I)I", &[&column.to_value()]);
}

fn get_scale(&self, column: i32) -> java::Result<i32> {
pub fn get_scale(&self, column: i32) -> java::Result<i32> {
return jvm_call!(int: self, "getScale", "(I)I", &[&column.to_value()]);
}

fn get_schema_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
pub fn get_schema_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
return jvm_call!(string: self, "getSchemaName", "(I)Ljava/lang/String;", &[&column.to_value()]);
}

fn get_table_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
pub fn get_table_name(&self, column: i32) -> java::Result<Option<std::string::String>> {
return jvm_call!(string: self, "getTableName", "(I)Ljava/lang/String;", &[&column.to_value()]);
}

fn is_auto_increment(&self, column: i32) -> java::Result<bool> {
pub fn is_auto_increment(&self, column: i32) -> java::Result<bool> {
return jvm_call!(bool: self, "isAutoIncrement", "(I)Z", &[&column.to_value()]);
}

fn is_case_sensitive(&self, column: i32) -> java::Result<bool> {
pub fn is_case_sensitive(&self, column: i32) -> java::Result<bool> {
return jvm_call!(bool: self, "isCaseSensitive", "(I)Z", &[&column.to_value()]);
}

fn is_currency(&self, column: i32) -> java::Result<bool> {
pub fn is_currency(&self, column: i32) -> java::Result<bool> {
return jvm_call!(bool: self, "isCurrency", "(I)Z", &[&column.to_value()]);
}

fn is_definitely_writable(&self, column: i32) -> java::Result<bool> {
pub fn is_definitely_writable(&self, column: i32) -> java::Result<bool> {
return jvm_call!(bool: self, "isDefinitelyWritable", "(I)Z", &[&column.to_value()]);
}

fn is_nullable(&self, column: i32) -> java::Result<i32> {
pub fn is_nullable(&self, column: i32) -> java::Result<i32> {
return jvm_call!(int: self, "isNullable", "(I)I", &[&column.to_value()]);
}

fn is_read_only(&self, column: i32) -> java::Result<bool> {
pub fn is_read_only(&self, column: i32) -> java::Result<bool> {
return jvm_call!(bool: self, "isReadOnly", "(I)Z", &[&column.to_value()]);
}

fn is_searchable(&self, column: i32) -> java::Result<bool> {
pub fn is_searchable(&self, column: i32) -> java::Result<bool> {
return jvm_call!(bool: self, "isSearchable", "(I)Z", &[&column.to_value()]);
}

fn is_signed(&self, column: i32) -> java::Result<bool> {
pub fn is_signed(&self, column: i32) -> java::Result<bool> {
return jvm_call!(bool: self, "isSigned", "(I)Z", &[&column.to_value()]);
}

fn is_writable(&self, column: i32) -> java::Result<bool> {
pub fn is_writable(&self, column: i32) -> java::Result<bool> {
return jvm_call!(bool: self, "isWritable", "(I)Z", &[&column.to_value()]);
}
}

impl IResultSetMetaData for ResultSetMetaData {}
// impl IResultSetMetaData for ResultSetMetaData {}