Told you, we love sharing!
In my current PhoneGap project, I was required to give the offline support of the application. I had to store all the external files on the device and refer the file from local device path. This required a thorough knowledge of storing external files on a device using PhoneGap. PhoneGap comes with very handy FileTransfer API which...
Phonegap gives me the freedom of creating mobile app with my existing knowledge of HTML, CSS, Javascript. It has a very nice javascript API to access the device features like camera, contacts, file etc. There are times when you need know where your files are stored. Specially when you are providing the offline support of the app...
We already know that by default Grails scaffold comes with Optimistic locking and it is achieved by version field. Now lets see how Pessimistic locking is achieved in Grails. Grails has a built in method to acquire lock on object. To acquire a lock we will do something like following [java] Book book = Book.get(1) book.lock() ...
Whenever I have the use case of inheritance in my Grails application I prefer to have the single table for all the classes, to avoid joins and multiple save statement. But one thing I dont like about this is its class discriminator which have the full class name in it. I dont find it much readable when looking into the sql. ...
In Grails, we can have inheritance with the abstract base class as well as persistent base class. Lets take an example to explain this.(All the classes are in the package com.intelligrape.example) [java] class Blog{ String authorName static constraints = { authorName (nullable:false) } } class TextBlog ...
Currently I am working on developing mobile app using Phonegap. Phonegap comes up with very nice javascript methods to access phone specific api and the developer like me who have fair knowledge of javascript HTML and CSS can learn it very quickly. My app required bundling the database into the app but there is no straight forward way...
In Grails optimistic locking is achieved by version property . The Grails Domain classes has a built in property called "version". This property can be used for optimistic locking. Although you can remove this property [java] static mapping ={ version false } [/java] but its not a very good practice. The initial value of...
I am a linux user and like to do everything on command line, I find it more productive. Anytime I need to write long command or use any command frequently, I always create an alias for that, for example while running the test cases I need to run the command so I created alias for this in my bashrc [java] alias testunit='grails...
Grails uses Sitemesh for adding layout to the views. Layouts are located in layouts folder and to add layouts to the view we generally add any of the following line in head [java] <g:applyLayout name="layoutName"/> or <meta name="layout" content="layoutName" /> [/java] But most of the time...