android - ORMLite get single database column -


i'm trying use sql command ormlite:

select address receive 

with code:

list<receivers> receiver_address = receiverdao.querybuilder().selectcolumns("address").query(); 

but object returned is:

1 = {receivers@830028192208}   address = {string@830028192264} "my new address"  city = null  email = null  telephone = null  mobile = null  name_family = null  national_code = null  postal_code = null  receiver_name = null  id = 2 

i need address field in query without iterator such as:

list<string> list = new arraylist<string>(); for( receivers lst:receiver_address)     list.add(lst.getaddress()); 

how action?

you can use rawrowmapper here:

list<string> addresses = receiverdao.queryraw("select address receive", new rawrowmapper<string>() {        @override        public string maprow(string[] columnnames, string[] resultcolumns) throws sqlexception {             return resultcolumns[0];        } }).getresults(); 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -