Home > Articles by: Faisal Basra

Faisal Basra
Author's details
Name: Faisal Basra
Date registered: February 8, 2010
URL: http://www.javaplex.com
Biography
Faisal Basra is an independent consultant, software developer, writer, blogger, speaker, architect and technology leader in Lahore, Pakistan. He has been a professional software developer since 2008, has been writing code since 2006.Having hands on experience of popular Java EE frameworks & technologies like JSF, Spring, Hibernate, Enverse, JPA, Richfaces, Primefaces, JSP/Servlet.Tools & Servers: jUnit, Log4j, Maven, Eclipse, MyEclipse, NetBeans, Tomcat, Jboss, WebLogicMobile Development: Google Android
Latest posts
- Linux Cron Job for MySQL Backup by Shell Scripting — February 14, 2012
- Simple CSV Generator — January 30, 2012
- Java Sorting Objects at Runtime using Comparator — January 26, 2012
- Hibernate Enum Datatype Mapping — January 26, 2012
- Hibernate persist() vs. save() — January 17, 2012
Most commented posts
- Sharing EvDo USB device on Wireless Router TP-Link, D-Link, LinkSys — 39 comments
- Using Your Laptop/PC Wi-Fi as Wi-Fi Router — 22 comments
- Composition and Aggregation using Java — 19 comments
- Optimizing JSF Richfaces Applications — 18 comments
- The Memory Usage by a Java Program — 7 comments
Author's posts listings

Recently, I was working on to automate MySQL database backup by writing shell script. Then we schedule the cron job which execute this backup shell script at 2:00 AM daily. This was my first shell coding experience on Ubuntu Linux Server 10.04 and I enjoyed a lot of learning Linux and related stuff. I am …
Continue reading »
Permanent link to this article: http://www.javaplex.com/blog/linux-cron-job-for-mysql-backup-by-shell-scripting/

I want to share a very simple example which can be used to generate CSV in Java. The code is self explanatory and easy to understand.
Permanent link to this article: http://www.javaplex.com/blog/simple-csv-generator/

Java gives very convenient way for sorting collection types by Collections.sort method. It have two flavors Collections.sort( collection, new Comparator < T>( )){} This is runtime sorting, & you will create an anonymous class implementation and will override Comparator’s compare method and return value -1, 0 , 1. Collections.sort( collection) You provide collection whose objects implemented Comparable or Comparator interface …
Continue reading »
Permanent link to this article: http://www.javaplex.com/blog/java-sorting-objects-at-runtime-using-comparator/

If you want to map a enum in JPA/Hibernate POJO class, so that only specific values can be saved for underlying database column, it is possible now very easily. The sample POJO File is given below, have an idea. @Enumerated( javax.persistence.EnumType.STRING ) tells what values you want into database from provided enum type, & hibernate will …
Continue reading »
Permanent link to this article: http://www.javaplex.com/blog/hibernate-enum-datatype-mapping/

In case anybody finds this thread… For persist() The semantics of this method are defined by JSR-220. persist() is well defined. It makes a transient instance persistent. However, it doesn’t guarantee that the identifier value will be assigned to the persistent instance immediately, the assignment might happen at flush time. The spec doesn’t say that, …
Continue reading »
Permanent link to this article: http://www.javaplex.com/blog/hibernate-persist-vs-save/

How to Enable EL 2 for Java Server Faces 2.x on server running older EL version EXCEPTION: com.sun.faces.config.ConfigurationException: It appears the JSP version of the container is older than 2.1 and unable to locate the EL RI expression factory, com.sun.el.ExpressionFactoryImpl. If not using JSP or the EL RI, make sure the context initialization parameter, com.sun.faces.expressionFactory, …
Continue reading »
Permanent link to this article: http://www.javaplex.com/blog/for-jsf-2-how-to-enable-el-2-2-on-tomcat-6/

If you are using Hibernate with Spring, then you will be dealing with huge set of DAOs. In such case best way to minimize the DAO work with Generic DAO patter, which encapsulate CRUD + basic finder method and then write only very required methods. I’m inspired by the IBM Generic DAO pattern and rewrite …
Continue reading »
Permanent link to this article: http://www.javaplex.com/blog/generic-dao-with-hibernate-and-spring/

Simple Spring Memcached (http://www NULL.slideshare NULL.net/nelz9999/simple-spring-memcached)
Permanent link to this article: http://www.javaplex.com/blog/spring-caching-with-simple-spring-memcached-ssm/

Hibernate meant to be Database independent ORM solution, but while migrating to another database vendor some key issues arrives. One of them is Auto ID generation of underlying database. MySQL, Oracle & MS SQL Server all uses different techniques to generate auto ID for primary keys. So, when we start migrating we face lot of …
Continue reading »
Permanent link to this article: http://www.javaplex.com/blog/how-to-achieve-database-auto-id-generation-portability-in-hibernate/

Most of the time you want to perform hibernate reverse engineering to generate Pojos from underlying database using hibernate-tools or directly from My Eclipse which also uses hibernate-tools. But some times we want to control the mechanism by which hibernate tools generate pojos, like we want to have prefix or suffix in our class name …
Continue reading »
Permanent link to this article: http://www.javaplex.com/blog/myeclipse-customizing-hibernate-reverse-engineering/
Page 1 of 812345...»Last »