Apache Derby Part 3

You can use the SQL client tool, such as “SQuirreL SQL Client” for creating the tables and managing your data. At the first time, even you log in as your decided user name, the schema that related to user name has not be presented. It will presented after you have finished creating a least one table. My previous post mention about “the system will prompt you to provide the default schema, at the moment please choose “APP”. At the moment, you have your own schema which is related to your user name already. After you connect to your database via NetBeans you can extract your connection node and choose your schema as a default schema by right click at the schema which same as your user name and choose “Set as Default Schema”. It’s nice to create some tables for further using via the JPA. I prefer to have at least 3 tables as following: –

1. The master table as a parent.

2. The detail table as a child of the master with one-to-many relationship.

3. The lookup table for the master table with one-to-one relationship, e.g. the constant table which contains code and description.

Since someone told me that there is an interesting feature for Java EE 6: JPA 2.0, so that you can manage the child data via the POJO accessing through LIST or COLLECTION e.g. create new elements, update or delete elements. When save the parent object, all related child objects changing will be applied automatically without any line of code. I’m not sure if it is called “Cascading Persist” or not.

Later I will find further information and try my best to prove it.

About Charlee Chitsuk

I've been working as a software developer since 1998. At the moment I focus on system integration including with SOA and Enterprise Security Solution.

Posted on June 11, 2010, in Database and tagged . Bookmark the permalink. Leave a comment.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: