Search This Blog

Saturday, 14 September 2013

Hibernate's custom annotations

In the previous few posts we saw how JPA provides us with an annotation driven approach to configure our entities. As with all standard APIs, when vendors implemented JPA, they found that the annotations did not cover every nifty trick provided by the implementations.

Monday, 9 September 2013

Different Message Formats in Spring MVC

In an earlier post we saw how Spring depended on MessageConverters to convert the request stream to java object and also the java objects to appropriate response formats.
As we had defined a Jackson converter, our controller's return objects were converted by the DispatcherServlet to JSON.

Saturday, 7 September 2013

Injecting Dependencies in a CXF Endpoint

We have seen how easy it is to create CXF endpoints. In the previous post on WSDL first web services we had defined server endpoints as:
<jaxws:endpoint id="randomWs"
   implementor="com.ws.service.samplews_ns.SampleServiceOperationsPortTypeImpl"
   address="randomService" />
The "randomWs" endpoint is a CXF endpoint capable of processing SOAP requests, It is also a spring managed bean.

Tuesday, 3 September 2013

Exception Handling in Spring REST calls

I earlier did a post on error handling in Spring web applications. It was related to generating views for errors. But in a REST application we would prefer to return error codes or error JSON message. While the earlier style can be still used here to write out an appropriate JSON error response, Spring MVC provides other mechanisms to handle errors.

Saturday, 31 August 2013

CacheModes in Hibernate - continued

In the previous post we saw the GET and IGNORE values for CacheMode. The other values are PUT and REFRESH. Consider the below code: