While doing code-review I came across hibernate’s dynamic-insert property and found it really useful. dynamic-insert is a boolean attribute of class element as defined in hibernate-mapping-3.0.dtd. This is an optional attribute of the class element and if not defined explicitly defaults to false.
As the name says, setting this property to true makes insert query generated by hibernate dynamic i.e. it will include only non-null values of DTO in the prepared statement.
Let’s explore this with the help of an example, for which I’m using PostgreSQL 9 and Hibernate 5.1.0.
Our annual vacation would be incomplete if it didn’t have a beach destination. Kovalam’s pristine beaches was our last stop in Kerala before we flew back home.
We checked-out from the houseboat and headed straight for Kovalam. This was the first stretch where we didn’t halt on the way and it took a little over 4 hours to reach there. We had booked Garden View Room at Turtle on the Beach via MakeMyTrip and the only non-Oyo & non-budget booking. As soon as we entered the hotel we were welcomed with shell garland, drink and wet hand towels. After finishing the formalities, we headed to the room and were accompanied by a lady staff who explained all the hotel amenities and in room features. WOW! Especially since, we had never ever received such a warm welcome from any of our previous hotels and it felt really awesome. The room was very clean and spacious. And guess what, it had a bath tub, which we thought was only there in the costlier beach view rooms. The last leg of our Kerala trip had got off to a wonderful start. For us Turtle on the Beach has set a new benchmark in luxury hotel.
Previously they had private access to beach, but since the pathway no longer exists they provide free pickup and drop to beach, which we never used since Hawa Beach is just 200 meters from the hotel.
In the evening we headed to the beach and explored around. The main beach area consists of two interconnected beaches, Hawa beach and Lighthouse Beach, former getting its name from the topless tourists that used to throng there (doesn’t happen anymore) and the later from the lighthouse at the end of the beach. We headed to the lighthouse only to find out that it closes doors at 5PM. We headed back to the beach, enjoyed the beautiful sunset and retreated back.
The main attraction of Alleppey is houseboat and we started searching for houseboat from the day we decided we were going to Kerala. We couldn’t finalize any from the ones we found online and finally our uncle who had been to Kerala a few months ago gave us the contact details of guy on whose houseboat they had stayed. After some lengthy discussions and a bit of haggling we finalized on Deluxe Houseboat Plan which would cost us ₹7000. In the deluxe plan the AC would work only during the night time and include lunch, evening snacks, dinner and breakfast. The check-in timing would be 12PM and checkout at 9AM.
Now, Munnar to Alleppey is about 180km and takes almost 6 hours to reach there accounting for a couple of halts in between. We were planning to stay only for one night in Alleppey and that too on the houseboat. So to make it on time for the house boat check-in at 12PM we would have to leave latest by 6 AM and would leave us too tired to enjoy the houseboat. So we decided that we will stay one night in Alleppey then next day go to the houseboat.
As planned we post checkout we headed to Munnar Tea Museum and left from there for Alleppy by 12 o’clock. We took one halt for lunch on the way and reached Alleppey by 4 o’clock.
Our booking for Alleppey too were done via Oyo rooms and the hotel was A.J Park. The hotel’s interior were good and the rooms were also good, clean but cramped. Despite being Oyo Premium the room didn’t even have mini refrigerator and toilet paper was missing.
In the evening we headed towards Alleppey beach which was 1.8 km from the hotel, so we went there walking. We spent the evening on the beach, saw the beautiful sunset and then came back to hotel restaurant for dinner.
After spending two days at the Grand Hotel, it was time to say goodbye to Kochi and head to Munnar. Munnar is a hill station situated at around 1,600 meters (5,200 ft.) above sea level and is about 130 km from Kochi and take roughly 4 hours by road. The road to Munnar is nice but is very tight and twisty and can give motion sickness to even seasoned travellers. Our colleagues had advised us to keep the breakfast light for the same reason and boy were we glad we listened to them.
We had hired a car for 5 days that would take us from Kochi to Munnar to Alleppey to Kovalam and had requested that the car be there by 9:30. Our driver, Sabu was there well before that and we left for Munnar at 9:30 sharp. En route we stopped at Cheeyappara Waterfalls, Valara Waterfalls, A Spice Gardern along with a waterfall, a view point and a dam whose names we can’t recollect. All these stops ensured that we didn’t have to use the sickness bag.
For our stay at Munnar, we had booked Isaac’s Residency via Oyo Rooms. The room was decently sized and was clean enough, although it wouldn’t have won any prizes for it. The hotel is located on a hill giving a beautiful view of Munnar Town.
In the evening we headed out for a leisurely stroll across the town and then called it a day.
Kochi was our entry point to Kerala and stayed there for 2 days.
We took a direct flight from Mumbai to Kochi and it took 2 hours to reach there. Kochi Airport has prepaid taxi facility, a little on the expensive side but very safe. We booked a non ac prepaid taxi to our hotel at M.G. Road, Erankulam and it cost us ₹830 for the 35 km trip and it took us close to 1 hour to reach the hotel.
The weather was hot and humid I would say slightly more humid than Mumbai.
We had booked our rooms via Oyo at Grand Hotel, M.G. Road. When we reached, we were told our booking was of standard room but were being upgraded to Execute room, WOW! The room was clean and spacious.
After checking in, we had our lunch in Grand hotel itself. We were really excited to try Kerala cuisine, so we ordered a Vaza Ilayil Pollicha Meen and a Kerala Chicken Thali. As the quantity of an individual thali would have been too much for me, we thought we will share it, but were told sharing a thali is not allowed in restaurant. Then the waiter himself suggested that along with one chicken thali you order one plate plain rice then you both can share gravy but not rice. After some time, we got to know that they provide unlimited rice with thali that’s why sharing is not allowed
M.G. Road is the city center of Kochi, where you’ll see everything from Government Offices, High Court to local and branded stores. So, in evening we headed to see Marine Drive which was just 15 minutes’ walk from the hotel. The real surprise for us was that maximum shops closed after sunset