Class DefaultSqlRow

java.lang.Object
io.ebeaninternal.server.query.DefaultSqlRow
All Implemented Interfaces:
io.ebean.SqlRow, Serializable, Map<String,Object>

public final class DefaultSqlRow extends Object implements io.ebean.SqlRow
Used to return raw SQL query results.

Refer to SqlQuery for 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.

See Also:
  • Constructor Details

    • DefaultSqlRow

      public DefaultSqlRow(int initialCapacity, float loadFactor, String dbTrueValue, boolean optimizedBinaryUUID)
      Create with an initialCapacity and loadFactor.

      The defaults of these are 16 and 0.75.

      Note that the Map will rehash the contents when the number of keys in this map reaches its threshold (initialCapacity * loadFactor).

  • Method Details

    • keys

      public Iterator<String> keys()
      Specified by:
      keys in interface io.ebean.SqlRow
    • remove

      public Object remove(Object name)
      Specified by:
      remove in interface Map<String,Object>
      Specified by:
      remove in interface io.ebean.SqlRow
    • get

      public Object get(Object name)
      Specified by:
      get in interface Map<String,Object>
      Specified by:
      get in interface io.ebean.SqlRow
    • put

      public Object put(String name, Object value)
      Specified by:
      put in interface Map<String,Object>
      Specified by:
      put in interface io.ebean.SqlRow
    • set

      public Object set(String name, Object value)
      Specified by:
      set in interface io.ebean.SqlRow
    • getUUID

      public UUID getUUID(String name)
      Specified by:
      getUUID in interface io.ebean.SqlRow
    • getBoolean

      public Boolean getBoolean(String name)
      Specified by:
      getBoolean in interface io.ebean.SqlRow
    • getInteger

      public Integer getInteger(String name)
      Specified by:
      getInteger in interface io.ebean.SqlRow
    • getBigDecimal

      public BigDecimal getBigDecimal(String name)
      Specified by:
      getBigDecimal in interface io.ebean.SqlRow
    • getLong

      public Long getLong(String name)
      Specified by:
      getLong in interface io.ebean.SqlRow
    • getDouble

      public Double getDouble(String name)
      Specified by:
      getDouble in interface io.ebean.SqlRow
    • getFloat

      public Float getFloat(String name)
      Specified by:
      getFloat in interface io.ebean.SqlRow
    • getString

      public String getString(String name)
      Specified by:
      getString in interface io.ebean.SqlRow
    • getUtilDate

      public Date getUtilDate(String name)
      Specified by:
      getUtilDate in interface io.ebean.SqlRow
    • getDate

      public Date getDate(String name)
      Specified by:
      getDate in interface io.ebean.SqlRow
    • getTimestamp

      public Timestamp getTimestamp(String name)
      Specified by:
      getTimestamp in interface io.ebean.SqlRow
    • toString

      public String toString()
      Specified by:
      toString in interface io.ebean.SqlRow
      Overrides:
      toString in class Object
    • clear

      public void clear()
      Specified by:
      clear in interface Map<String,Object>
      Specified by:
      clear in interface io.ebean.SqlRow
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<String,Object>
      Specified by:
      containsKey in interface io.ebean.SqlRow
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<String,Object>
      Specified by:
      containsValue in interface io.ebean.SqlRow
    • entrySet

      public Set<Map.Entry<String,Object>> entrySet()
      Specified by:
      entrySet in interface Map<String,Object>
      Specified by:
      entrySet in interface io.ebean.SqlRow
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<String,Object>
      Specified by:
      isEmpty in interface io.ebean.SqlRow
    • keySet

      public Set<String> keySet()
      Specified by:
      keySet in interface Map<String,Object>
      Specified by:
      keySet in interface io.ebean.SqlRow
    • putAll

      public void putAll(Map<? extends String, ?> t)
      Specified by:
      putAll in interface Map<String,Object>
      Specified by:
      putAll in interface io.ebean.SqlRow
    • size

      public int size()
      Specified by:
      size in interface Map<String,Object>
      Specified by:
      size in interface io.ebean.SqlRow
    • values

      public Collection<Object> values()
      Specified by:
      values in interface Map<String,Object>
      Specified by:
      values in interface io.ebean.SqlRow