Homework 3
CS520, Spring 2009


Due: Friday, April 24

Package all the source files of your project into a zip file using the zip Ant target you developed in Homework 1, and upload the zip file to CSNS. Note that file uploading will be disabled automatically after 11:59PM of the due date, so please turn in your work on time.


[Reading]

[Blogs for CSNS]

Blogs is a new component of CSNS which you will develop in this quarter. In this assignment you are going to implement the model classes and the database schema based on the following requirements:

[Model] (20pt)

Design and implement the model classes for the blogs component, i.e. Blog, BlogEntry, and Comment. You may also need to change some existing classes. The classes should be placed under the package csns.model.blog. Note that in this assignment you only need to create the model classes. Operations such as creating blogs and adding entries/comments will be implemented later in subsequent assignments.

[Hibernate Mapping] (30pt)

Create Hibernate mapping files for the classes you created in the previous exercise, and place these mapping files under src/hbm/blog. If you have changed any existing classes in the previous exercise, you need to modify their Hibernate mapping files accordingly.

Run the hbm2ddl Ant task to generate a new db/csns.ddl file and check if the database schema is what you expect.

[Database Scripts] (20pt)

Based on the csns.ddl file generated in the previous exercise, modify the following database scripts:

Details of the test cases, i.e. blog title, content of the entries, and so on, are up to you.

[Subversion]

Commit all the changes to your Subversion repository, and create a tag called cs520-hw3.