JPA

Blue futuristic stream Data Communication flying into digital technologic animation 3D rendering

Spring Data JPA Transaction Management

Reading Time: 3 minutes Spring Data JPA Transaction Management : A Spring Data JPA Transaction Management has a sequence of actions that are bundled as a single piece of work. It is an important part of RDMBS-oriented applications to ensure data consistency and integrity. The transaction is a set of SQL statements that is naturally automatic in nature to manage the data. It has the following four key properties Continue Reading

Querying Array of String using JPA Specification

Reading Time: 2 minutes Writing dynamic queries using JPA Specification could be a hard to understand and implement but lets make it simple and easy to understand! To query array of string in postgreSQL , we might use a query like this : select * from employee where ARRAY_TO_STRING(keywords, ‘,’) LIKE ‘%lunch%’; To use specification for querying array string datatype ,we will have to Define a custom dialect to Continue Reading

How to set default column value in JPA

Reading Time: < 1 minute There might be a situation when you want to set the default value of column in spring boot. You might be thinking how to set it even when you have set the default value in the database but you still get a null value stored in the database . It is because JPA includes the columns with null value in the insert query which you Continue Reading

A simple CRUD application in Play! Framework using Kundera and Cassandra as a Database.

Reading Time: < 1 minute playing-kundera-cassandra: This is a classic CRUD application, backed by Play 2.3.0, Kundera & Cassandra. It demonstrates: Accessing a Cassandra database, using Kundera. Achieving, Futures to use more idiomatic error handling. Accessing JS & CSS libraries by WebJars. Bootswatch-United with Twitter Bootstrap 3.1.1 to improve the look and feel of the application Instructions :- The Github code for the project is at : playing-kundera-cassandra Clone the project Continue Reading

Improve Performance By Using Batch Gets on Google App Engine

Reading Time: 2 minutes We are porting a JPA application to Google App Engine. One of the challenges we faced during this exercise was performance. There are simple and effective ways by which we can increase the performance of our application. Datastore batch get is one such optimization we used during porting the application. If you are used to low level datastore api you must have used batch get. Continue Reading

Google App Engine More JPA Gotchas

Reading Time: 2 minutes We were in process of porting an application to GAE. The application used JPA for persistence and we decided to use the same for GAE as well. After deploying, the application worked fine on Google App Engine. Over a period of time we started getting errors, which seemed strange. All our tests were running fine and application worked without any issues with our seed data. Continue Reading

Google App Engine Some JPA Gotchas

Reading Time: 2 minutes While porting an application to Google App Engine we encountered several issues. Most of them where related to persistence. We were using JPA for persistence in the application. One of the most common mistake we did was in issuing a JPA Query where one or more parameters are of type com.google.appengine.datastore.api.Key class. Key class has two String representations which lead to some confusion. Let’s look Continue Reading

Improve Performance By Using Keys Only Query on Google App Engine

Reading Time: 2 minutes It has been around two months since we started to port an existing application on Google App engine. It used Hibernate for persistence, Wicket framework for web layer and Spring as an Ioc container. Looking at the will it play on appengine we had to change Hibernate to use either JPA or JDO. We decided on JPA purely on the basis of experience we had Continue Reading

Problems When Deploying Working Application on Google App Engine

Reading Time: 3 minutes Google Dev and production environment has differences. You may run into problems if you expect that application will also run fine on app engine if there are no errors on app engine development server. We are in process of porting an existing application on Google App engine. The application we are building uses Wicket, Spring and JPA. If you read the will it play in Continue Reading

Managing Multiple Parent Persistence Problem in App Engine

Reading Time: 3 minutes We are in process of porting an entire application on google app engine. This application has persistence using JPA and as usual contains mapping between entities using annotations. The mapping like @OnetoMany and @ManytoOne in Jpa may throw lot of errors in google app engine and therefore is neither straightforward nor trivial. In this blog we will see where our mapping may fail, with specific Continue Reading

Unit Testing Maven Based JPA Application on GAE

Reading Time: 3 minutes Recently, we started porting a complex enterprise timesheet and invoicing application to Google App Engine. We would talk about the strategy that we are following as a part of separate post but in this post let us look at how we can unit test JPA code effectively in our local environment. By the way, the application that we are porting does not use JPA but Continue Reading