Thursday, 25 April 2013

GWT SDK Not Installed error in eclipse

Error


Solution
Change <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/> in eccount-controller/.classpath



to the Top of eccount-controller/.classpath


Tuesday, 16 April 2013

Eclipse in Depth

update emacs keymap


[1] Resource Filter
To exclude files other than .java while searching via Ctrl+Shift+R, right click on folder to be excluded and configure the resource as follows :



[2] Eclipse Profile
STEP 1 : Goto Preference-Java-Formatter



STEP 2 : Edit Profile




[3] Change Color Theme





Also see - https://upd-dreamspace.blogspot.com/2013/10/tips-for-intellij-idea.html

Saturday, 6 April 2013

Web Technology Stack I Prefer on JVM

[1] GWTP - GWT RPC - Spring Data
GWT is the best choice when I need to manipulate complex actions in a single page, like gmail.



References
Picking a Technology Stack
https://docs.google.com/presentation/d/1pA6reUNKqkfupSogZB4Q42Tk98VAq_loqkIDE-HSxAE/present#slide=id.g4b18f43_1_18

What is a good or proven technology stack to build a web based startup today ?,
http://www.quora.com/What-is-a-good-or-proven-technology-stack-to-build-a-web-based-startup-today

Analysis of web technology stacks, http://stackoverflow.com/a/6703950/432903

Thursday, 4 April 2013

Hacking on JPA Criteria


[1] CriteriaBuilder
CriteriaBuilder interface is the factory for CriteriaQuery. A CriteriaBuilder is obtained from either an EntityManagerFactory or an EntityManager.


EntityManager em = ... ; 
CriteriaBuilder queryBuilder = em.getCriteriaBuilder();
CriteriaQuery criteriaQuery = queryBuilder.createQuery();



[2] CriteriaQuery

Root<User> user = criteriaQuery.from(User.class);




[3] Root
Query roots specify the domain objects on which the query is evaluated. Query root is an instance of the Root<T> interface.

Root<History> histories = user.join(user.get(User_.histories));

criteriaQuery.where(user.get(User_.userName).equal("prayag@zazzercode.com")
              .and(histories.get(History_.historyType).equal(HistoryType.ADD).not()));

criteriaQuery.select(user.get(User_.userName), histories.get(Hostory_.historyType));

The attribute "userName" refers to a valid persistent property of User(the receiving domain object).




[4] Predicate



References
Chapter 11.  JPA Criteria,
http://openjpa.apache.org/builds/2.1.1/apache-openjpa/docs/jpa_overview_criteria.html

Chapter 3.  Java Persistence API Architecture,
http://openjpa.apache.org/builds/1.0.0/apache-openjpa-1.0.0/docs/manual/jpa_overview_arch.html

Chapter 15. Criteria Queries,
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/querycriteria.html

Crash Introduction to Modern Java Data Access: Understanding JPA, Hibernate, MyBatis, and pureQuery, http://www.slideshare.net/OnBuildingSoftware/crash-introduction-to-modern-java-data-access-understanding-jpa-hibernate-mybatis-and-purequery

http://www.javaworld.com/javaworld/jw-01-2008/jw-01-jpa1.html