Ebean Select only particular Column
<p>i have a class product with fields id , name , price etc,...</p>

<p>i want to fetch only name from the table ..</p>

<p>Am currently using this query </p>

<pre><code> String sql =   "select name from product where price = 100";
 SqlQuery sqlQuery = Ebean.createSqlQuery(sql);
  List&lt;SqlRow&gt; list = sqlQuery.findList();
</code></pre>

<p>what is the alerternate way to find using  List but fetch only name </p>

<pre><code>List&lt;product&gt; list = product.find.where("price = 100").select("name").findList();
</code></pre>

<p>i dont think the following query is efficient since it fetches all data and returns wat we filter it</p>

<pre><code>  List&lt;String&gt; list = new ArrayList&lt;String&gt;();

    for(product p: product.find.select("name").findList())
     {
        list.add(p.name);
    }


return list;
</code></pre>