Monday, October 16, 2006

Simple Sample to use Spring, xDoclet and Hibernate

I just revision how to use Hibernate, you need to understand about the one-to-one, one-to-many, many-to-many before use the Hibernate. Hibernate is not very complicate but you don't use any tools to help develop the application with Hibernate, you will feel hard.
In my experience, I suggest to use Eclipse 3.1.x & JBoss IDE plugins to develop the Hibernate and Spring application.

I will provide the simple project. It demo how to create one-to-one, one-to-many, many-to-many.
You need to pay attention on :
  1. persistent classes xDoclect's Hibernate tag.
  2. Spring configuration xml file ( hibernate.xml) - datasource, hbm config, bean of spring
  3. xDoclet configuration. Project > right click > property > XDoclect configuration
Hope this example can give you idea to use Spring and Hibernate.
** Sample download**

Useful resource to futher study Hibernate.
- HibernateGossip

Any problem, please feel free to contact me:
mingkit@gmail.com

Mylar is eclipse plugin for project management

Interest! I will read about it and write some article.
http://www-128.ibm.com/developerworks/java/library/j-mylar1/?ca=dgr-jw01Mylar-1

http://www.hibernate.org/43.html

MySQL add new user account

It is a very simple procedure but i usually forget. We also can search ther result from MYSQL homepage. Please login by root account.
mysql -u root

1. create user account.
- CREATE USER mingkit IDENTIFIED BY 'password';

2. grant right for the accout.
- for localhost
GRANT ALL PRIVILEGES ON *.* TO 'mingkit'localhost'IDENTIFIED BY 'password' WITH GRANT OPTION;

- for worldwide or certain ip
GRANT ALL PRIVILEGES ON *.* TO 'mingkit'%'IDENTIFIED BY 'password' WITH GRANT OPTION;