Database Reference
In-Depth Information
System.out.println(employee.getEmployeeId());
System.out.println(employee.getEmployeeName());
System.out.println(employee.getAddress());
System.out.println(employee.getDepartment());
Using ilters within query
To start using ilters with Kundera, perform the following steps:
1. Create the EntityManager instance and use the getDelegate method to get
the map of clients.
2. Fetch the client from the map of clients, speciic to your persistence-unit.
3.
Finally, create a Filter object of whichever ilter you want to use and set
it into the HbaseClient object:
Map<String, Client> clients = (Map<String, Client>)
em.getDelegate();
HBaseClient client = (HBaseClient) clients.get("hbaseTest");
Filter prefixFilter = new PrefixFilter(Bytes.toBytes("1"));
client.setFilter(prefixFilter);
The following code shows a few examples using the ilter while querying HBase
using Kundera:
String queryString = "Select e from Employee e";
Query query = em.createQuery(queryString);
List<Employee> employees = query.getResultList();
System.out.println(employees.size());
employee = employees.get(0);
System.out.println(employee.getEmployeeId());
System.out.println(employee.getEmployeeName());
System.out.println(employee.getAddress());
System.out.println(employee.getDepartment());
Filter keyOnlyFilter = new KeyOnlyFilter();
 
Search WWH ::




Custom Search