Introduction

In the first part of the Blog tutorial, you will learn:

Create the database model

We will build a small database model for the blog. The database will have two tables: BlogEntry and Author.

BlogEntry will have the following columns:

Column name

Type

Constraints

id

integer

primary key

title

string(255)

 

content

string(4000)

 

lastModified

timestamp

 

creationDate

timestamp

 

author

integer

relation with Author

Author will have the following columns:

Column name

Type

Constraints

id

integer

primary key

firstName

string(100)

 

lastName

string(100)

 

email

string(150)

unique

passwd

string(16)

 

To create the database, we will first create a EOModel and use migrations to build the database on the file system (H2 will take care of creating the database file).