Play, EBean - SQLException Column Index out range 0 < 1

March 2, 2016

Problem:

Caused by: java.sql.SQLException: Column Index out of range, 0 < 1.

Solution:

Ebean “translates” the result columns names to “productEanId”, “productId” and “ean”. The solution is to give as alias the exact same names of the property to which the columns are going to be assigned:
<![CDATA[ (…) String sql = “select icecat_product_ean.product_ean_id productEANId, " + “icecat_product_ean.product_id productId, " + “icecat_product_ean.ean ean " + “from icecat_product_ean “; (…) ]]>
SyntaxHighlighter.highlight();