Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I am using EntityContainer class from <a href="http://vaadin.com/addon/lazy-query-container" rel="nofollow">lazyquerycontainer</a> addon. As name suggests, it supports lazy loading. It just works :)</p> <p>Some sample code:</p> <pre><code> resultsTable = new Table(); resultsTable.setSelectable(true); resultsTable.setCaption("JpaQuery"); resultsTable.setPageLength(40); resultsTable.setImmediate(true); resultsTable.setEditable(false); resultsTable.setWriteThrough(true); container = new EntityContainer&lt;Call&gt;(em, false, true, true, Call.class, 100, new Object[] {"imsi"}, new boolean[] {true}); container.addContainerProperty(LazyQueryView.PROPERTY_ID_ITEM_STATUS, QueryItemStatus.class, QueryItemStatus.None, true, false); container.addContainerProperty("startTime", Date.class, null, true, true); container.addContainerProperty("stopTime", Date.class, null, true, true); container.addContainerProperty("imsi", String.class, null, false, true); container.addContainerProperty("imei", String.class, null, false, true); container.addContainerProperty("callType", Integer.class, null, true, true); container.addContainerProperty("cdpn", String.class, null, true, true); container.addContainerProperty("cgpn", String.class, null, true, true); container.addContainerProperty("status", Integer.class, null, true, true); container.addContainerProperty("mmRelCause", Integer.class, null, true, true); container.addContainerProperty("rrRelCause", Integer.class, null, true, true); resultsTable.setContainerDataSource(container); resultsTable.setVisibleColumns(new String[] {"startTime" , "stopTime" , "imsi", "imei", "callType" , "cdpn", "cgpn", "status", "mmRelCause" , "rrRelCause" }); resultsTable.setColumnHeaders(new String[] {"Start time", "Stop time", "IMSI", "IMEI", "Call Type", "CDPN", "CGPN", "Status", "MM Release Cause", "RR Release Cause"}); resultsTable.setColumnCollapsingAllowed(true); resultsTable.setColumnCollapsed("mmRelCause", true); resultsTable.setColumnCollapsed("rrRelCause", true); </code></pre> <p>To filter the data basing on JQL, you can execute <code>filter</code> method passing filter string and map of bind variables.</p> <pre><code>... whereParameters.put("stopTimeFrom", filterParams.getStopTimeFrom()); where = "e.startTime &gt;= :stopTimeFrom"; ... container.filter(where, whereParameters); </code></pre> <p>If you prefere Criteria API, you can use <a href="http://vaadin.com/addon/jpa-criteria-lazy-container" rel="nofollow">criteriacontainer</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload