Package io.ebean
Interface SqlRow
-
- All Superinterfaces:
Map<String,Object>,Serializable
public interface SqlRow extends Serializable, Map<String,Object>
Used to return raw SQL query results.Refer to
SqlQueryfor examples.There are convenience methods such as getInteger(), getBigDecimal() etc. The reason for these methods is that the values put into this map often come straight from the JDBC resultSet. Depending on the JDBC driver it may put a different type into a given property. For example an Integer, BigDecimal, Double could all be put into a property depending on the JDBC driver used. These convenience methods automatically convert the value as required returning the type you expect.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Clear the map.booleancontainsKey(Object key)Returns true if the map contains the property.booleancontainsValue(Object value)Returns true if the map contains the value.Set<Map.Entry<String,Object>>entrySet()Returns the entrySet of the map.Objectget(Object name)Return a property value by its name.BigDecimalgetBigDecimal(String name)Return a property value as a BigDecimal.BooleangetBoolean(String name)Return a property as a Boolean.DategetDate(String name)Return the property as a sql date.DoublegetDouble(String name)Return the property value as a Double.FloatgetFloat(String name)Return the property value as a Float.IntegergetInteger(String name)Return a property as an Integer.LonggetLong(String name)Return a property value as a Long.StringgetString(String name)Return a property as a String.TimestampgetTimestamp(String name)Return the property as a sql timestamp.DategetUtilDate(String name)Return the property as a java.util.Date.UUIDgetUUID(String name)Return a property as a UUID.booleanisEmpty()Returns true if the map is empty.Iterator<String>keys()Return the property names (String).Set<String>keySet()Returns the key set of the map.Objectput(String name, Object value)Set a value to a property.voidputAll(Map<? extends String,?> t)Put all the values from t into this map.Objectremove(Object name)Remove a property from the map.Objectset(String name, Object value)Exactly the same as the put method.intsize()Return the size of the map.StringtoString()String description of the underlying map.Collection<Object>values()Return the values from this map.-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
keys
Iterator<String> keys()
Return the property names (String).Internally this uses LinkedHashMap and so the order of the property names should be predictable and ordered by the use of LinkedHashMap.
-
remove
Object remove(Object name)
Remove a property from the map. Returns the value of the removed property.
-
set
Object set(String name, Object value)
Exactly the same as the put method.I added this method because it seems more bean like to have get and set methods.
-
getBoolean
Boolean getBoolean(String name)
Return a property as a Boolean.
-
getInteger
Integer getInteger(String name)
Return a property as an Integer.
-
getBigDecimal
BigDecimal getBigDecimal(String name)
Return a property value as a BigDecimal.
-
getUtilDate
Date getUtilDate(String name)
Return the property as a java.util.Date.
-
getTimestamp
Timestamp getTimestamp(String name)
Return the property as a sql timestamp.
-
containsKey
boolean containsKey(Object key)
Returns true if the map contains the property.- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
boolean containsValue(Object value)
Returns true if the map contains the value.- Specified by:
containsValuein interfaceMap<String,Object>
-
isEmpty
boolean isEmpty()
Returns true if the map is empty.
-
-