[richfaces-svn-commits] JBoss Rich Faces SVN: r13863 - in trunk/examples/photoalbum: ejb/sql/full and 4 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Sat Apr 25 10:32:30 EDT 2009


Author: Alex.Kolonitsky
Date: 2009-04-25 10:32:30 -0400 (Sat, 25 Apr 2009)
New Revision: 13863

Modified:
   trunk/examples/photoalbum/ejb/pom.xml
   trunk/examples/photoalbum/ejb/sql/full/import.sql
   trunk/examples/photoalbum/ejb/sql/short/import.sql
   trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java
   trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Comment.java
   trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java
   trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/MetaTag.java
   trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Sex.java
   trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Shelf.java
   trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/User.java
   trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/AlbumAction.java
   trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/ImageAction.java
   trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
Log:
remove table and column names

Modified: trunk/examples/photoalbum/ejb/pom.xml
===================================================================
--- trunk/examples/photoalbum/ejb/pom.xml	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/pom.xml	2009-04-25 14:32:30 UTC (rev 13863)
@@ -24,6 +24,12 @@
             <version>1.0</version>
             <scope>provided</scope>
         </dependency>
+		<!--<dependency>-->
+			<!-- runtime requirement hibernate needs -->
+			<!--<groupId>org.slf4j</groupId>-->
+			<!--<artifactId>slf4j-log4j12</artifactId>-->
+			<!--<version>1.5.2</version>-->
+		<!--</dependency>-->
 	<dependency>
       <groupId>org.jboss.seam</groupId>
       <artifactId>jboss-seam</artifactId>
@@ -59,6 +65,7 @@
         	<groupId>org.hibernate</groupId>
         	<artifactId>hibernate-annotations</artifactId>
         	<version>3.3.0.ga</version>
+        	<!--<version>3.4.0.GA</version>-->
         	<scope>provided</scope>
         </dependency>
     </dependencies>
@@ -119,7 +126,59 @@
 		</resources>
 
 		<plugins>
-            <plugin>
+<!--
+			<plugin>
+				-->
+<!-- HIBERNATE 3 PLUGIN - this can output the DDL to a file -->
+<!--
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>hibernate3-maven-plugin</artifactId>
+				<version>2.0-alpha-2</version>
+				<executions>
+					<execution>
+						<phase>process-classes</phase>
+						<goals>
+							<goal>hbm2ddl</goal>
+						</goals>
+					</execution>
+				</executions>
+				<configuration>
+					<components>
+						<component>
+							<name>hbm2ddl</name>
+							<implementation>annotationconfiguration</implementation>
+						</component>
+					</components>
+					<componentProperties>
+						<implementation>jpaconfiguration</implementation>
+						<persistenceunit>entityManager</persistenceunit>
+						<outputfilename>myschema.ddl</outputfilename>
+						<propertyfile>${basedir}/src/main/resources/database.properties</propertyfile>
+						<drop>false</drop>
+						<create>true</create>
+						<export>false</export>
+						<format>true</format>
+					</componentProperties>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-eclipse-plugin</artifactId>
+				<configuration>
+					<downloadSources>true</downloadSources>
+					<downloadJavadocs>true</downloadJavadocs>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+				</configuration>
+			</plugin>
+			
+-->
+			<plugin>
                 <artifactId>maven-ejb-plugin</artifactId>
                 <configuration>
                     <ejbVersion>3.0</ejbVersion>

Modified: trunk/examples/photoalbum/ejb/sql/full/import.sql
===================================================================
--- trunk/examples/photoalbum/ejb/sql/full/import.sql	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/sql/full/import.sql	2009-04-25 14:32:30 UTC (rev 13863)
@@ -1,529 +1,535 @@
-INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (1,  'Andrey', 'Markhel', 'amarkhel at exadel.com',  'amarkhel', '8cb2237d0679ca88db6464eac60da96345513964',  '1985-01-08', 0, 0, true);
-INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (2,  'Nick',   'Curtis',  'nkurtis at iba.com',      'Viking',   '8cb2237d0679ca88db6464eac60da96345513964',  '1978-01-08', 1, 0, true);
-INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (3,  'John',   'Smith',   'jsmith at jboss.com',     'Noname',   '8cb2237d0679ca88db6464eac60da96345513964',  '1970-01-08', 1, 0, true);
+INSERT INTO User(id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (1,  'Andrey', 'Markhel', 'amarkhel at exadel.com',  'amarkhel', '8cb2237d0679ca88db6464eac60da96345513964',  '1985-01-08', 0, 0, true);
+INSERT INTO User(id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (2,  'Nick',   'Curtis',  'nkurtis at iba.com',      'Viking',   '8cb2237d0679ca88db6464eac60da96345513964',  '1978-01-08', 1, 0, true);
+INSERT INTO User(id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (3,  'John',   'Smith',   'jsmith at jboss.com',     'Noname',   '8cb2237d0679ca88db6464eac60da96345513964',  '1970-01-08', 1, 0, true);
 
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (1,  'Nature',  'Nature pictures',  1, '2009-12-18', true);
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (2,  'Sport',   'Nature pictures',  1, '2009-12-18', true);
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (3,  'Water',   'Nature pictures',  2, '2009-12-18', true);
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (4,  'Flowers', 'Nature pictures',  3, '2009-12-18', true);
+INSERT INTO Shelf(id, name, description, owner_id, created, shared) VALUES (1,  'Nature',  'Nature pictures',  1, '2009-12-18', true);
+INSERT INTO Shelf(id, name, description, owner_id, created, shared) VALUES (2,  'Sport',   'Nature pictures',  1, '2009-12-18', true);
+INSERT INTO Shelf(id, name, description, owner_id, created, shared) VALUES (3,  'Water',   'Nature pictures',  2, '2009-12-18', true);
+INSERT INTO Shelf(id, name, description, owner_id, created, shared) VALUES (4,  'Flowers', 'Nature pictures',  3, '2009-12-18', true);
 ---------------------------------------------------------------------
 -- ALBUM - Animals"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (0, 'Animals', 'Animals pictures',  1, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (0,  'Animals');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (0, 'Animals', 'Animals pictures',  1, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (0,  'Animals');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (0, '1750979205_6e51b47ce9_o.jpg', '1750979205_6e51b47ce9_o.jpg', 'Animals - 1750979205_6e51b47ce9_o.jpg image',  '2009-12-18', 0, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 0);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (1, '1906662004_655d0f6ccf_o.jpg', '1906662004_655d0f6ccf_o.jpg', 'Animals - 1906662004_655d0f6ccf_o.jpg image',  '2009-12-18', 0, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (0, '1985-01-08', 'Gorgeous! Lovely color!',1, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (1, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',1, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (2, '2090459727_f2888e5cbe_o.jpg', '2090459727_f2888e5cbe_o.jpg', 'Animals - 2090459727_f2888e5cbe_o.jpg image',  '2009-12-18', 0, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (2, '1985-01-08', 'this is extremely Good:) Congratulations!',2, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (3, '1985-01-08', 'whoah ! wonderful',2, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (4, '1985-01-08', 'fantastic shot !!!!!!',2, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (3, '2297752925_de29b5fb10_o.jpg', '2297752925_de29b5fb10_o.jpg', 'Animals - 2297752925_de29b5fb10_o.jpg image',  '2009-12-18', 0, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (5, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',3, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (6, '1985-01-08', '++Beautiful',3, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (7, '1985-01-08', 'Amazing shot..',3, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (4, '2298556444_2151b7a6c4_o.jpg', '2298556444_2151b7a6c4_o.jpg', 'Animals - 2298556444_2151b7a6c4_o.jpg image',  '2009-12-18', 0, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 4);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (8, '1985-01-08', 'fantastic shot !!!!!!',4, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (9, '1985-01-08', '++Beautiful',4, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (10, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',4, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (5, '2508246015_313952406c_o.jpg', '2508246015_313952406c_o.jpg', 'Animals - 2508246015_313952406c_o.jpg image',  '2009-12-18', 0, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 5);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (11, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',5, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (12, '1985-01-08', 'Amazing shot..',5, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (13, '1985-01-08', 'that is a beautiful flower with great colours ',5, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (6, '2521898117_f2ebf233c9_o.jpg', '2521898117_f2ebf233c9_o.jpg', 'Animals - 2521898117_f2ebf233c9_o.jpg image',  '2009-12-18', 0, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 6);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (14, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',6, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (7, '308709862_f8f7fbcec4_b.jpg', '308709862_f8f7fbcec4_b.jpg', 'Animals - 308709862_f8f7fbcec4_b.jpg image',  '2009-12-18', 0, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 7);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (8, '3390059723_4b2883ee59_o.jpg', '3390059723_4b2883ee59_o.jpg', 'Animals - 3390059723_4b2883ee59_o.jpg image',  '2009-12-18', 0, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 8);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (15, '1985-01-08', 'this is extremely Good:) Congratulations!',8, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (16, '1985-01-08', 'Beautiful colours. Nice close up. ',8, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (9, '3390865548_e394404198_o.jpg', '3390865548_e394404198_o.jpg', 'Animals - 3390865548_e394404198_o.jpg image',  '2009-12-18', 0, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 9);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (17, '1985-01-08', 'I Think this is Art!',9, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (18, '1985-01-08', 'that is a beautiful flower with great colours ',9, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (19, '1985-01-08', 'Gorgeous! Lovely color!',9, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (20, '1985-01-08', 'Bellissima macro!',9, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (10, '3390879696_059660d45c_o.jpg', '3390879696_059660d45c_o.jpg', 'Animals - 3390879696_059660d45c_o.jpg image',  '2009-12-18', 0, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 10);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (21, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',10, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (22, '1985-01-08', 'this is extremely Good:) Congratulations!',10, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (11, '3390886140_b05ae25b14_o.jpg', '3390886140_b05ae25b14_o.jpg', 'Animals - 3390886140_b05ae25b14_o.jpg image',  '2009-12-18', 0, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 11);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (12, '3413588364_dd0d602b9b_o.jpg', '3413588364_dd0d602b9b_o.jpg', 'Animals - 3413588364_dd0d602b9b_o.jpg image',  '2009-12-18', 0, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 12);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (23, '1985-01-08', 'Wonderful.',12, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (24, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',12, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (13, '3415160108_c22eb69f37_o.jpg', '3415160108_c22eb69f37_o.jpg', 'Animals - 3415160108_c22eb69f37_o.jpg image',  '2009-12-18', 0, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 13);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (25, '1985-01-08', 'whoah ! wonderful',13, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (14, '3415165572_f6d48c2a21_o.jpg', '3415165572_f6d48c2a21_o.jpg', 'Animals - 3415165572_f6d48c2a21_o.jpg image',  '2009-12-18', 0, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 14);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (26, '1985-01-08', 'Very *lovely*',14, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (15, '839245545_5db77619d5_o.jpg', '839245545_5db77619d5_o.jpg', 'Animals - 839245545_5db77619d5_o.jpg image',  '2009-12-18', 0, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 15);
-UPDATE albums set coveringimage_image_id=15 where album_id = 0;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (0, '1750979205_6e51b47ce9_o.jpg', '1750979205_6e51b47ce9_o.jpg', 'Animals - 1750979205_6e51b47ce9_o.jpg image',  '2009-12-18', 0, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 0);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (0, '1985-01-08', '++Beautiful',0, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (1, '1985-01-08', 'this is extremely Good:) Congratulations!',0, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (2, '1985-01-08', 'Very *lovely*',0, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (1, '1906662004_655d0f6ccf_o.jpg', '1906662004_655d0f6ccf_o.jpg', 'Animals - 1906662004_655d0f6ccf_o.jpg image',  '2009-12-18', 0, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (3, '1985-01-08', 'fantastic shot !!!!!!',1, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (2, '2090459727_f2888e5cbe_o.jpg', '2090459727_f2888e5cbe_o.jpg', 'Animals - 2090459727_f2888e5cbe_o.jpg image',  '2009-12-18', 0, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (4, '1985-01-08', 'fantastic shot !!!!!!',2, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (5, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',2, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (3, '2297752925_de29b5fb10_o.jpg', '2297752925_de29b5fb10_o.jpg', 'Animals - 2297752925_de29b5fb10_o.jpg image',  '2009-12-18', 0, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (6, '1985-01-08', 'Gorgeous! Lovely color!',3, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (7, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',3, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (8, '1985-01-08', 'Amazing shot..',3, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (9, '1985-01-08', '++Beautiful',3, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (4, '2298556444_2151b7a6c4_o.jpg', '2298556444_2151b7a6c4_o.jpg', 'Animals - 2298556444_2151b7a6c4_o.jpg image',  '2009-12-18', 0, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 4);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (10, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',4, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (11, '1985-01-08', 'Beautiful colours. Nice close up. ',4, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (5, '2508246015_313952406c_o.jpg', '2508246015_313952406c_o.jpg', 'Animals - 2508246015_313952406c_o.jpg image',  '2009-12-18', 0, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 5);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (6, '2521898117_f2ebf233c9_o.jpg', '2521898117_f2ebf233c9_o.jpg', 'Animals - 2521898117_f2ebf233c9_o.jpg image',  '2009-12-18', 0, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 6);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (7, '308709862_f8f7fbcec4_b.jpg', '308709862_f8f7fbcec4_b.jpg', 'Animals - 308709862_f8f7fbcec4_b.jpg image',  '2009-12-18', 0, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 7);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (12, '1985-01-08', 'Amazing shot..',7, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (8, '3390059723_4b2883ee59_o.jpg', '3390059723_4b2883ee59_o.jpg', 'Animals - 3390059723_4b2883ee59_o.jpg image',  '2009-12-18', 0, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 8);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (9, '3390865548_e394404198_o.jpg', '3390865548_e394404198_o.jpg', 'Animals - 3390865548_e394404198_o.jpg image',  '2009-12-18', 0, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 9);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (10, '3390879696_059660d45c_o.jpg', '3390879696_059660d45c_o.jpg', 'Animals - 3390879696_059660d45c_o.jpg image',  '2009-12-18', 0, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 10);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (13, '1985-01-08', 'Stunning capture! :-)',10, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (14, '1985-01-08', 'nice shot =) ',10, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (11, '3390886140_b05ae25b14_o.jpg', '3390886140_b05ae25b14_o.jpg', 'Animals - 3390886140_b05ae25b14_o.jpg image',  '2009-12-18', 0, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 11);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (15, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',11, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (16, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',11, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (17, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',11, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (18, '1985-01-08', 'Amazing shot..',11, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (12, '3413588364_dd0d602b9b_o.jpg', '3413588364_dd0d602b9b_o.jpg', 'Animals - 3413588364_dd0d602b9b_o.jpg image',  '2009-12-18', 0, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 12);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (19, '1985-01-08', 'Stunning capture! :-)',12, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (20, '1985-01-08', 'that is a beautiful flower with great colours ',12, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (21, '1985-01-08', 'I Think this is Art!',12, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (13, '3415160108_c22eb69f37_o.jpg', '3415160108_c22eb69f37_o.jpg', 'Animals - 3415160108_c22eb69f37_o.jpg image',  '2009-12-18', 0, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 13);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (14, '3415165572_f6d48c2a21_o.jpg', '3415165572_f6d48c2a21_o.jpg', 'Animals - 3415165572_f6d48c2a21_o.jpg image',  '2009-12-18', 0, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 14);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (22, '1985-01-08', 'Perfecft!',14, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (23, '1985-01-08', 'Perfecft!',14, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (15, '839245545_5db77619d5_o.jpg', '839245545_5db77619d5_o.jpg', 'Animals - 839245545_5db77619d5_o.jpg image',  '2009-12-18', 0, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 15);
+UPDATE Album set coveringImage_id=15 where id = 0;
 
 ---------------------------------------------------------------------
 -- ALBUM - Cars"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (1, 'Cars', 'Cars pictures',  3, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (1,  'Cars');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (1, 'Cars', 'Cars pictures',  3, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (1,  'Cars');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (16, '190193308_ce2a4de5fa_o.jpg', '190193308_ce2a4de5fa_o.jpg', 'Cars - 190193308_ce2a4de5fa_o.jpg image',  '2009-12-18', 1, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 16);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (27, '1985-01-08', 'Such a lovely colour azaga!',16, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (28, '1985-01-08', 'Beautiful colours. Nice close up. ',16, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (17, '1941230817_bcce17b8ef_o.jpg', '1941230817_bcce17b8ef_o.jpg', 'Cars - 1941230817_bcce17b8ef_o.jpg image',  '2009-12-18', 1, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 17);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (29, '1985-01-08', 'Bellísima.!!! saludos.',17, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (18, '2151423750_129317a034_o.jpg', '2151423750_129317a034_o.jpg', 'Cars - 2151423750_129317a034_o.jpg image',  '2009-12-18', 1, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 18);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (30, '1985-01-08', 'Stunning capture! :-)',18, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (19, '2233985073_9a3fd7d3ac_b.jpg', '2233985073_9a3fd7d3ac_b.jpg', 'Cars - 2233985073_9a3fd7d3ac_b.jpg image',  '2009-12-18', 1, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 19);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (20, '2386071696_2b4e84eddb_o.jpg', '2386071696_2b4e84eddb_o.jpg', 'Cars - 2386071696_2b4e84eddb_o.jpg image',  '2009-12-18', 1, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 20);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (31, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',20, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (32, '1985-01-08', 'Amazing shot..',20, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (33, '1985-01-08', 'whoah ! wonderful',20, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (21, '3089719367_a03a2b55a4_b.jpg', '3089719367_a03a2b55a4_b.jpg', 'Cars - 3089719367_a03a2b55a4_b.jpg image',  '2009-12-18', 1, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 21);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (34, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',21, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (35, '1985-01-08', 'love every thing about this picture, really beautiful... :))',21, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (36, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',21, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (22, '3200944376_2867888262_b.jpg', '3200944376_2867888262_b.jpg', 'Cars - 3200944376_2867888262_b.jpg image',  '2009-12-18', 1, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 22);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (37, '1985-01-08', 'I Think this is Art!',22, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (23, '3286825259_2a927e8ec1_o.jpg', '3286825259_2a927e8ec1_o.jpg', 'Cars - 3286825259_2a927e8ec1_o.jpg image',  '2009-12-18', 1, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 23);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (38, '1985-01-08', 'fantastic shot !!!!!!',23, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (39, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',23, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (40, '1985-01-08', 'that is a beautiful flower with great colours ',23, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (24, '3287637120_c1b3495371_o.jpg', '3287637120_c1b3495371_o.jpg', 'Cars - 3287637120_c1b3495371_o.jpg image',  '2009-12-18', 1, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 24);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (25, '3327664478_7f77093f52_o.jpg', '3327664478_7f77093f52_o.jpg', 'Cars - 3327664478_7f77093f52_o.jpg image',  '2009-12-18', 1, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 25);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (41, '1985-01-08', 'nice shot =) ',25, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (42, '1985-01-08', 'Beautiful colours. Nice close up. ',25, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (43, '1985-01-08', 'Gorgeous! Lovely color!',25, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (26, '361088850_73d4bef19a_o.jpg', '361088850_73d4bef19a_o.jpg', 'Cars - 361088850_73d4bef19a_o.jpg image',  '2009-12-18', 1, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 26);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (44, '1985-01-08', 'Bellissima macro!',26, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (27, '361091514_20cd7e7eea_o.jpg', '361091514_20cd7e7eea_o.jpg', 'Cars - 361091514_20cd7e7eea_o.jpg image',  '2009-12-18', 1, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 27);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (28, '361092609_25d6d4bd90_o.jpg', '361092609_25d6d4bd90_o.jpg', 'Cars - 361092609_25d6d4bd90_o.jpg image',  '2009-12-18', 1, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 28);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (29, '400440032_a63fe65cab_o.jpg', '400440032_a63fe65cab_o.jpg', 'Cars - 400440032_a63fe65cab_o.jpg image',  '2009-12-18', 1, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 29);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (45, '1985-01-08', 'this is extremely Good:) Congratulations!',29, 2);
-UPDATE albums set coveringimage_image_id=29 where album_id = 1;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (16, '190193308_ce2a4de5fa_o.jpg', '190193308_ce2a4de5fa_o.jpg', 'Cars - 190193308_ce2a4de5fa_o.jpg image',  '2009-12-18', 1, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 16);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (24, '1985-01-08', 'Bellísima.!!! saludos.',16, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (25, '1985-01-08', 'Gorgeous! Lovely color!',16, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (17, '1941230817_bcce17b8ef_o.jpg', '1941230817_bcce17b8ef_o.jpg', 'Cars - 1941230817_bcce17b8ef_o.jpg image',  '2009-12-18', 1, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 17);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (18, '2151423750_129317a034_o.jpg', '2151423750_129317a034_o.jpg', 'Cars - 2151423750_129317a034_o.jpg image',  '2009-12-18', 1, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 18);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (26, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',18, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (27, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',18, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (19, '2233985073_9a3fd7d3ac_b.jpg', '2233985073_9a3fd7d3ac_b.jpg', 'Cars - 2233985073_9a3fd7d3ac_b.jpg image',  '2009-12-18', 1, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 19);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (20, '2386071696_2b4e84eddb_o.jpg', '2386071696_2b4e84eddb_o.jpg', 'Cars - 2386071696_2b4e84eddb_o.jpg image',  '2009-12-18', 1, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 20);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (28, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',20, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (29, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',20, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (30, '1985-01-08', 'whoah ! wonderful',20, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (21, '3089719367_a03a2b55a4_b.jpg', '3089719367_a03a2b55a4_b.jpg', 'Cars - 3089719367_a03a2b55a4_b.jpg image',  '2009-12-18', 1, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 21);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (31, '1985-01-08', 'Gorgeous! Lovely color!',21, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (22, '3200944376_2867888262_b.jpg', '3200944376_2867888262_b.jpg', 'Cars - 3200944376_2867888262_b.jpg image',  '2009-12-18', 1, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 22);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (32, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',22, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (33, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',22, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (23, '3286825259_2a927e8ec1_o.jpg', '3286825259_2a927e8ec1_o.jpg', 'Cars - 3286825259_2a927e8ec1_o.jpg image',  '2009-12-18', 1, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 23);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (34, '1985-01-08', 'fantastic shot !!!!!!',23, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (35, '1985-01-08', 'Beautiful colours. Nice close up. ',23, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (24, '3287637120_c1b3495371_o.jpg', '3287637120_c1b3495371_o.jpg', 'Cars - 3287637120_c1b3495371_o.jpg image',  '2009-12-18', 1, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 24);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (36, '1985-01-08', 'Bellissima macro!',24, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (37, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',24, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (25, '3327664478_7f77093f52_o.jpg', '3327664478_7f77093f52_o.jpg', 'Cars - 3327664478_7f77093f52_o.jpg image',  '2009-12-18', 1, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 25);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (38, '1985-01-08', 'Wonderful.',25, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (26, '361088850_73d4bef19a_o.jpg', '361088850_73d4bef19a_o.jpg', 'Cars - 361088850_73d4bef19a_o.jpg image',  '2009-12-18', 1, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 26);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (39, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',26, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (40, '1985-01-08', 'fantastic shot !!!!!!',26, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (41, '1985-01-08', 'love every thing about this picture, really beautiful... :))',26, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (27, '361091514_20cd7e7eea_o.jpg', '361091514_20cd7e7eea_o.jpg', 'Cars - 361091514_20cd7e7eea_o.jpg image',  '2009-12-18', 1, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 27);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (28, '361092609_25d6d4bd90_o.jpg', '361092609_25d6d4bd90_o.jpg', 'Cars - 361092609_25d6d4bd90_o.jpg image',  '2009-12-18', 1, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 28);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (42, '1985-01-08', 'Bellissima macro!',28, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (43, '1985-01-08', 'nice shot =) ',28, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (44, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',28, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (29, '400440032_a63fe65cab_o.jpg', '400440032_a63fe65cab_o.jpg', 'Cars - 400440032_a63fe65cab_o.jpg image',  '2009-12-18', 1, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 29);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (45, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',29, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (46, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',29, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (47, '1985-01-08', 'this is extremely Good:) Congratulations!',29, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (48, '1985-01-08', 'I Think this is Art!',29, 2);
+UPDATE Album set coveringImage_id=29 where id = 1;
 
 ---------------------------------------------------------------------
 -- ALBUM - Monuments and just buildings"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (2, 'Monuments and just buildings', 'Monuments and just buildings pictures',  4, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (2,  'Monuments and just buildings');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (2, 'Monuments and just buildings', 'Monuments and just buildings pictures',  4, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (2,  'Monuments and just buildings');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (30, '05[303x457].jpg', '05[303x457].jpg', 'Monuments and just buildings - 05[303x457].jpg image',  '2009-12-18', 2, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 30);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (31, '07[303x457].jpg', '07[303x457].jpg', 'Monuments and just buildings - 07[303x457].jpg image',  '2009-12-18', 2, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 31);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (46, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',31, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (47, '1985-01-08', 'Bellísima.!!! saludos.',31, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (48, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',31, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (49, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',31, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (32, '1805365000_ca64d20b10_o.jpg', '1805365000_ca64d20b10_o.jpg', 'Monuments and just buildings - 1805365000_ca64d20b10_o.jpg image',  '2009-12-18', 2, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 32);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (50, '1985-01-08', 'Bellissima macro!',32, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (51, '1985-01-08', 'Such a lovely colour azaga!',32, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (33, '1[303x457].jpg', '1[303x457].jpg', 'Monuments and just buildings - 1[303x457].jpg image',  '2009-12-18', 2, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 33);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (52, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',33, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (53, '1985-01-08', 'Gorgeous! Lovely color!',33, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (54, '1985-01-08', 'Perfecft!',33, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (55, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',33, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (34, '2099090261_1efb89ae95_o.jpg', '2099090261_1efb89ae95_o.jpg', 'Monuments and just buildings - 2099090261_1efb89ae95_o.jpg image',  '2009-12-18', 2, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 34);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (56, '1985-01-08', 'that is a beautiful flower with great colours ',34, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (57, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',34, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (58, '1985-01-08', 'Bellissima macro!',34, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (35, '2976358258_5c08813ddf_o.jpg', '2976358258_5c08813ddf_o.jpg', 'Monuments and just buildings - 2976358258_5c08813ddf_o.jpg image',  '2009-12-18', 2, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 35);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (59, '1985-01-08', 'I Think this is Art!',35, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (36, '2[457x303].jpg', '2[457x303].jpg', 'Monuments and just buildings - 2[457x303].jpg image',  '2009-12-18', 2, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 36);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (60, '1985-01-08', 'whoah ! wonderful',36, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (37, '32971256_8bd6bf165d_o.jpg', '32971256_8bd6bf165d_o.jpg', 'Monuments and just buildings - 32971256_8bd6bf165d_o.jpg image',  '2009-12-18', 2, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 37);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (61, '1985-01-08', 'that is a beautiful flower with great colours ',37, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (62, '1985-01-08', 'Stunning capture! :-)',37, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (63, '1985-01-08', 'fantastic shot !!!!!!',37, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (38, '3392872753_e47f1c7078_o.jpg', '3392872753_e47f1c7078_o.jpg', 'Monuments and just buildings - 3392872753_e47f1c7078_o.jpg image',  '2009-12-18', 2, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 38);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (64, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',38, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (65, '1985-01-08', 'this is extremely Good:) Congratulations!',38, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (39, '3397511520_9839039136_o.jpg', '3397511520_9839039136_o.jpg', 'Monuments and just buildings - 3397511520_9839039136_o.jpg image',  '2009-12-18', 2, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 39);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (66, '1985-01-08', 'Such a lovely colour azaga!',39, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (40, '3399540332_576df61129_o.jpg', '3399540332_576df61129_o.jpg', 'Monuments and just buildings - 3399540332_576df61129_o.jpg image',  '2009-12-18', 2, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 40);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (67, '1985-01-08', 'Stunning capture! :-)',40, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (68, '1985-01-08', 'Bellísima.!!! saludos.',40, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (69, '1985-01-08', 'Beautiful colours. Nice close up. ',40, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (41, '3403152285_3e72d1264a_o.jpg', '3403152285_3e72d1264a_o.jpg', 'Monuments and just buildings - 3403152285_3e72d1264a_o.jpg image',  '2009-12-18', 2, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 41);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (70, '1985-01-08', 'Bellissima macro!',41, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (71, '1985-01-08', '++Beautiful',41, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (72, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',41, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (73, '1985-01-08', 'that is a beautiful flower with great colours ',41, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (42, '3413630679_d77f525413_o.jpg', '3413630679_d77f525413_o.jpg', 'Monuments and just buildings - 3413630679_d77f525413_o.jpg image',  '2009-12-18', 2, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 42);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (74, '1985-01-08', 'whoah ! wonderful',42, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (75, '1985-01-08', 'whoah ! wonderful',42, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (76, '1985-01-08', 'Very *lovely*',42, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (77, '1985-01-08', 'Stunning capture! :-)',42, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (43, '3414974777_a4f44f69c7_o.jpg', '3414974777_a4f44f69c7_o.jpg', 'Monuments and just buildings - 3414974777_a4f44f69c7_o.jpg image',  '2009-12-18', 2, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 43);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (78, '1985-01-08', 'Very *lovely*',43, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (79, '1985-01-08', 'Beautiful colours. Nice close up. ',43, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (80, '1985-01-08', 'Perfecft!',43, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (44, '3415278215_968db2dbbf_o.jpg', '3415278215_968db2dbbf_o.jpg', 'Monuments and just buildings - 3415278215_968db2dbbf_o.jpg image',  '2009-12-18', 2, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 44);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (81, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',44, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (82, '1985-01-08', 'Stunning capture! :-)',44, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (83, '1985-01-08', 'that is a beautiful flower with great colours ',44, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (45, '3415840434_949aeabf08_o.jpg', '3415840434_949aeabf08_o.jpg', 'Monuments and just buildings - 3415840434_949aeabf08_o.jpg image',  '2009-12-18', 2, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 45);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (46, '370031898_84e952e0b0_o.jpg', '370031898_84e952e0b0_o.jpg', 'Monuments and just buildings - 370031898_84e952e0b0_o.jpg image',  '2009-12-18', 2, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 46);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (84, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',46, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (85, '1985-01-08', 'nice shot =) ',46, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (86, '1985-01-08', 'Stunning capture! :-)',46, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (87, '1985-01-08', 'this is extremely Good:) Congratulations!',46, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (47, '381889523_f276d45e9d_o.jpg', '381889523_f276d45e9d_o.jpg', 'Monuments and just buildings - 381889523_f276d45e9d_o.jpg image',  '2009-12-18', 2, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 47);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (88, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',47, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (48, '441026665_07699ebddd_o.jpg', '441026665_07699ebddd_o.jpg', 'Monuments and just buildings - 441026665_07699ebddd_o.jpg image',  '2009-12-18', 2, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 48);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (89, '1985-01-08', 'whoah ! wonderful',48, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (49, '4[457x303].jpg', '4[457x303].jpg', 'Monuments and just buildings - 4[457x303].jpg image',  '2009-12-18', 2, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 49);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (50, '960942349_dcc90c0a61_o.jpg', '960942349_dcc90c0a61_o.jpg', 'Monuments and just buildings - 960942349_dcc90c0a61_o.jpg image',  '2009-12-18', 2, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 50);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (90, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',50, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (91, '1985-01-08', '++Beautiful',50, 2);
-UPDATE albums set coveringimage_image_id=50 where album_id = 2;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (30, '05[303x457].jpg', '05[303x457].jpg', 'Monuments and just buildings - 05[303x457].jpg image',  '2009-12-18', 2, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 30);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (49, '1985-01-08', 'I Think this is Art!',30, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (31, '07[303x457].jpg', '07[303x457].jpg', 'Monuments and just buildings - 07[303x457].jpg image',  '2009-12-18', 2, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 31);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (50, '1985-01-08', 'I Think this is Art!',31, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (51, '1985-01-08', 'nice shot =) ',31, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (52, '1985-01-08', 'whoah ! wonderful',31, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (32, '1805365000_ca64d20b10_o.jpg', '1805365000_ca64d20b10_o.jpg', 'Monuments and just buildings - 1805365000_ca64d20b10_o.jpg image',  '2009-12-18', 2, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 32);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (33, '1[303x457].jpg', '1[303x457].jpg', 'Monuments and just buildings - 1[303x457].jpg image',  '2009-12-18', 2, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 33);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (34, '2099090261_1efb89ae95_o.jpg', '2099090261_1efb89ae95_o.jpg', 'Monuments and just buildings - 2099090261_1efb89ae95_o.jpg image',  '2009-12-18', 2, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 34);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (53, '1985-01-08', 'that is a beautiful flower with great colours ',34, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (54, '1985-01-08', 'Such a lovely colour azaga!',34, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (55, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',34, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (35, '2976358258_5c08813ddf_o.jpg', '2976358258_5c08813ddf_o.jpg', 'Monuments and just buildings - 2976358258_5c08813ddf_o.jpg image',  '2009-12-18', 2, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 35);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (56, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',35, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (57, '1985-01-08', 'Wonderful.',35, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (58, '1985-01-08', 'Bellissima macro!',35, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (36, '2[457x303].jpg', '2[457x303].jpg', 'Monuments and just buildings - 2[457x303].jpg image',  '2009-12-18', 2, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 36);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (59, '1985-01-08', 'Perfecft!',36, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (60, '1985-01-08', 'love every thing about this picture, really beautiful... :))',36, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (61, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',36, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (37, '32971256_8bd6bf165d_o.jpg', '32971256_8bd6bf165d_o.jpg', 'Monuments and just buildings - 32971256_8bd6bf165d_o.jpg image',  '2009-12-18', 2, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 37);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (62, '1985-01-08', 'Bellísima.!!! saludos.',37, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (63, '1985-01-08', 'Very *lovely*',37, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (64, '1985-01-08', 'Such a lovely colour azaga!',37, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (38, '3392872753_e47f1c7078_o.jpg', '3392872753_e47f1c7078_o.jpg', 'Monuments and just buildings - 3392872753_e47f1c7078_o.jpg image',  '2009-12-18', 2, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 38);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (39, '3397511520_9839039136_o.jpg', '3397511520_9839039136_o.jpg', 'Monuments and just buildings - 3397511520_9839039136_o.jpg image',  '2009-12-18', 2, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 39);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (40, '3399540332_576df61129_o.jpg', '3399540332_576df61129_o.jpg', 'Monuments and just buildings - 3399540332_576df61129_o.jpg image',  '2009-12-18', 2, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 40);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (65, '1985-01-08', 'Gorgeous! Lovely color!',40, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (66, '1985-01-08', 'this is extremely Good:) Congratulations!',40, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (67, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',40, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (41, '3403152285_3e72d1264a_o.jpg', '3403152285_3e72d1264a_o.jpg', 'Monuments and just buildings - 3403152285_3e72d1264a_o.jpg image',  '2009-12-18', 2, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 41);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (68, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',41, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (69, '1985-01-08', 'I Think this is Art!',41, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (70, '1985-01-08', 'love every thing about this picture, really beautiful... :))',41, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (71, '1985-01-08', 'Gorgeous! Lovely color!',41, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (42, '3413630679_d77f525413_o.jpg', '3413630679_d77f525413_o.jpg', 'Monuments and just buildings - 3413630679_d77f525413_o.jpg image',  '2009-12-18', 2, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 42);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (72, '1985-01-08', 'Bellísima.!!! saludos.',42, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (73, '1985-01-08', 'whoah ! wonderful',42, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (74, '1985-01-08', 'Stunning capture! :-)',42, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (75, '1985-01-08', 'Wonderful.',42, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (43, '3414974777_a4f44f69c7_o.jpg', '3414974777_a4f44f69c7_o.jpg', 'Monuments and just buildings - 3414974777_a4f44f69c7_o.jpg image',  '2009-12-18', 2, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 43);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (76, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',43, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (77, '1985-01-08', 'Perfecft!',43, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (78, '1985-01-08', 'Wonderful.',43, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (79, '1985-01-08', 'Such a lovely colour azaga!',43, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (44, '3415278215_968db2dbbf_o.jpg', '3415278215_968db2dbbf_o.jpg', 'Monuments and just buildings - 3415278215_968db2dbbf_o.jpg image',  '2009-12-18', 2, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 44);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (80, '1985-01-08', 'Stunning capture! :-)',44, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (81, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',44, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (45, '3415840434_949aeabf08_o.jpg', '3415840434_949aeabf08_o.jpg', 'Monuments and just buildings - 3415840434_949aeabf08_o.jpg image',  '2009-12-18', 2, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 45);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (82, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',45, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (83, '1985-01-08', 'this is extremely Good:) Congratulations!',45, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (84, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',45, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (85, '1985-01-08', 'Amazing shot..',45, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (46, '370031898_84e952e0b0_o.jpg', '370031898_84e952e0b0_o.jpg', 'Monuments and just buildings - 370031898_84e952e0b0_o.jpg image',  '2009-12-18', 2, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 46);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (86, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',46, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (87, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',46, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (88, '1985-01-08', 'fantastic shot !!!!!!',46, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (89, '1985-01-08', 'Bellissima macro!',46, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (47, '381889523_f276d45e9d_o.jpg', '381889523_f276d45e9d_o.jpg', 'Monuments and just buildings - 381889523_f276d45e9d_o.jpg image',  '2009-12-18', 2, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 47);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (90, '1985-01-08', 'fantastic shot !!!!!!',47, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (48, '441026665_07699ebddd_o.jpg', '441026665_07699ebddd_o.jpg', 'Monuments and just buildings - 441026665_07699ebddd_o.jpg image',  '2009-12-18', 2, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 48);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (91, '1985-01-08', 'that is a beautiful flower with great colours ',48, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (92, '1985-01-08', 'Bellissima macro!',48, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (93, '1985-01-08', 'I Think this is Art!',48, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (49, '4[457x303].jpg', '4[457x303].jpg', 'Monuments and just buildings - 4[457x303].jpg image',  '2009-12-18', 2, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 49);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (50, '960942349_dcc90c0a61_o.jpg', '960942349_dcc90c0a61_o.jpg', 'Monuments and just buildings - 960942349_dcc90c0a61_o.jpg image',  '2009-12-18', 2, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 50);
+UPDATE Album set coveringImage_id=50 where id = 2;
 
 ---------------------------------------------------------------------
 -- ALBUM - Nature"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (3, 'Nature', 'Nature pictures',  2, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (3,  'Nature');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (3, 'Nature', 'Nature pictures',  2, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (3,  'Nature');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (51, '01[303x202].jpg', '01[303x202].jpg', 'Nature - 01[303x202].jpg image',  '2009-12-18', 3, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 51);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (92, '1985-01-08', 'Wonderful.',51, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (93, '1985-01-08', 'love every thing about this picture, really beautiful... :))',51, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (94, '1985-01-08', 'Such a lovely colour azaga!',51, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (52, '1[305x457].jpg', '1[305x457].jpg', 'Nature - 1[305x457].jpg image',  '2009-12-18', 3, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 52);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (53, '273927725_c9f5ef5952_o.jpg', '273927725_c9f5ef5952_o.jpg', 'Nature - 273927725_c9f5ef5952_o.jpg image',  '2009-12-18', 3, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 53);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (95, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',53, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (96, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',53, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (97, '1985-01-08', 'whoah ! wonderful',53, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (98, '1985-01-08', 'that is a beautiful flower with great colours ',53, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (54, '2[303x457].jpg', '2[303x457].jpg', 'Nature - 2[303x457].jpg image',  '2009-12-18', 3, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 54);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (99, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',54, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (100, '1985-01-08', 'fantastic shot !!!!!!',54, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (55, '3392730627_1cdb18cba6_o.jpg', '3392730627_1cdb18cba6_o.jpg', 'Nature - 3392730627_1cdb18cba6_o.jpg image',  '2009-12-18', 3, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 55);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (101, '1985-01-08', 'Stunning capture! :-)',55, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (102, '1985-01-08', 'Bellissima macro!',55, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (56, '3392993334_36d7f097df_o.jpg', '3392993334_36d7f097df_o.jpg', 'Nature - 3392993334_36d7f097df_o.jpg image',  '2009-12-18', 3, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 56);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (57, '3393235094_7cc613d363_o.jpg', '3393235094_7cc613d363_o.jpg', 'Nature - 3393235094_7cc613d363_o.jpg image',  '2009-12-18', 3, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 57);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (103, '1985-01-08', 'nice shot =) ',57, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (104, '1985-01-08', 'nice shot =) ',57, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (58, '3412793157_683290a536_o.jpg', '3412793157_683290a536_o.jpg', 'Nature - 3412793157_683290a536_o.jpg image',  '2009-12-18', 3, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 58);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (105, '1985-01-08', 'Bellísima.!!! saludos.',58, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (106, '1985-01-08', 'nice shot =) ',58, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (107, '1985-01-08', 'Amazing shot..',58, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (59, '3414996504_b42abb3be6_o.jpg', '3414996504_b42abb3be6_o.jpg', 'Nature - 3414996504_b42abb3be6_o.jpg image',  '2009-12-18', 3, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 59);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (108, '1985-01-08', 'love every thing about this picture, really beautiful... :))',59, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (60, '3415639261_20d2d3b52c_o.jpg', '3415639261_20d2d3b52c_o.jpg', 'Nature - 3415639261_20d2d3b52c_o.jpg image',  '2009-12-18', 3, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 60);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (61, '3416307534_40f6616283_o.jpg', '3416307534_40f6616283_o.jpg', 'Nature - 3416307534_40f6616283_o.jpg image',  '2009-12-18', 3, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 61);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (109, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',61, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (62, '3416321407_068332d9f2_o.jpg', '3416321407_068332d9f2_o.jpg', 'Nature - 3416321407_068332d9f2_o.jpg image',  '2009-12-18', 3, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 62);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (110, '1985-01-08', 'Wonderful.',62, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (111, '1985-01-08', 'fantastic shot !!!!!!',62, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (112, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',62, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (63, '3416371116_f793561d19_o.jpg', '3416371116_f793561d19_o.jpg', 'Nature - 3416371116_f793561d19_o.jpg image',  '2009-12-18', 3, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 63);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (113, '1985-01-08', '++Beautiful',63, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (114, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',63, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (115, '1985-01-08', 'Such a lovely colour azaga!',63, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (116, '1985-01-08', 'fantastic shot !!!!!!',63, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (64, '3417131300_2aac5ec32c_o.jpg', '3417131300_2aac5ec32c_o.jpg', 'Nature - 3417131300_2aac5ec32c_o.jpg image',  '2009-12-18', 3, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 64);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (117, '1985-01-08', 'Very *lovely*',64, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (65, '3417132360_56d0b48a9d_o.jpg', '3417132360_56d0b48a9d_o.jpg', 'Nature - 3417132360_56d0b48a9d_o.jpg image',  '2009-12-18', 3, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 65);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (118, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',65, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (66, '3417319507_8d1f2d5c77_o.jpg', '3417319507_8d1f2d5c77_o.jpg', 'Nature - 3417319507_8d1f2d5c77_o.jpg image',  '2009-12-18', 3, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 66);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (119, '1985-01-08', 'Such a lovely colour azaga!',66, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (120, '1985-01-08', '++Beautiful',66, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (121, '1985-01-08', 'that is a beautiful flower with great colours ',66, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (122, '1985-01-08', 'Perfecft!',66, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (67, '3417494725_e21724aba9_o.jpg', '3417494725_e21724aba9_o.jpg', 'Nature - 3417494725_e21724aba9_o.jpg image',  '2009-12-18', 3, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 67);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (123, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',67, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (124, '1985-01-08', 'that is a beautiful flower with great colours ',67, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (125, '1985-01-08', '++Beautiful',67, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (68, '3418371942_a61ae58de4_o.jpg', '3418371942_a61ae58de4_o.jpg', 'Nature - 3418371942_a61ae58de4_o.jpg image',  '2009-12-18', 3, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 68);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (69, '345009210_1f826cd5a1_o.jpg', '345009210_1f826cd5a1_o.jpg', 'Nature - 345009210_1f826cd5a1_o.jpg image',  '2009-12-18', 3, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 69);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (126, '1985-01-08', 'Bellísima.!!! saludos.',69, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (127, '1985-01-08', 'Amazing shot..',69, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (70, '55109059_55408b3d5f_o.jpg', '55109059_55408b3d5f_o.jpg', 'Nature - 55109059_55408b3d5f_o.jpg image',  '2009-12-18', 3, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 70);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (71, '570841724_b11c8b0df2_o.jpg', '570841724_b11c8b0df2_o.jpg', 'Nature - 570841724_b11c8b0df2_o.jpg image',  '2009-12-18', 3, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 71);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (128, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',71, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (129, '1985-01-08', '++Beautiful',71, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (72, '672840660_4a91f39f02_o.jpg', '672840660_4a91f39f02_o.jpg', 'Nature - 672840660_4a91f39f02_o.jpg image',  '2009-12-18', 3, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 72);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (130, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',72, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (131, '1985-01-08', 'Stunning capture! :-)',72, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (132, '1985-01-08', 'this is extremely Good:) Congratulations!',72, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (133, '1985-01-08', 'this is extremely Good:) Congratulations!',72, 3);
-UPDATE albums set coveringimage_image_id=72 where album_id = 3;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (51, '01[303x202].jpg', '01[303x202].jpg', 'Nature - 01[303x202].jpg image',  '2009-12-18', 3, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 51);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (94, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',51, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (52, '1[305x457].jpg', '1[305x457].jpg', 'Nature - 1[305x457].jpg image',  '2009-12-18', 3, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 52);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (53, '273927725_c9f5ef5952_o.jpg', '273927725_c9f5ef5952_o.jpg', 'Nature - 273927725_c9f5ef5952_o.jpg image',  '2009-12-18', 3, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 53);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (95, '1985-01-08', 'love every thing about this picture, really beautiful... :))',53, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (96, '1985-01-08', 'that is a beautiful flower with great colours ',53, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (97, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',53, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (54, '2[303x457].jpg', '2[303x457].jpg', 'Nature - 2[303x457].jpg image',  '2009-12-18', 3, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 54);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (98, '1985-01-08', 'Bellísima.!!! saludos.',54, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (99, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',54, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (100, '1985-01-08', 'Gorgeous! Lovely color!',54, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (55, '3392730627_1cdb18cba6_o.jpg', '3392730627_1cdb18cba6_o.jpg', 'Nature - 3392730627_1cdb18cba6_o.jpg image',  '2009-12-18', 3, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 55);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (56, '3392993334_36d7f097df_o.jpg', '3392993334_36d7f097df_o.jpg', 'Nature - 3392993334_36d7f097df_o.jpg image',  '2009-12-18', 3, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 56);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (101, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',56, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (102, '1985-01-08', '++Beautiful',56, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (103, '1985-01-08', 'I Think this is Art!',56, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (57, '3393235094_7cc613d363_o.jpg', '3393235094_7cc613d363_o.jpg', 'Nature - 3393235094_7cc613d363_o.jpg image',  '2009-12-18', 3, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 57);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (58, '3412793157_683290a536_o.jpg', '3412793157_683290a536_o.jpg', 'Nature - 3412793157_683290a536_o.jpg image',  '2009-12-18', 3, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 58);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (59, '3414996504_b42abb3be6_o.jpg', '3414996504_b42abb3be6_o.jpg', 'Nature - 3414996504_b42abb3be6_o.jpg image',  '2009-12-18', 3, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 59);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (104, '1985-01-08', 'Beautiful colours. Nice close up. ',59, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (105, '1985-01-08', 'Wonderful.',59, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (60, '3415639261_20d2d3b52c_o.jpg', '3415639261_20d2d3b52c_o.jpg', 'Nature - 3415639261_20d2d3b52c_o.jpg image',  '2009-12-18', 3, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 60);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (106, '1985-01-08', 'Such a lovely colour azaga!',60, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (107, '1985-01-08', 'fantastic shot !!!!!!',60, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (108, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',60, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (61, '3416307534_40f6616283_o.jpg', '3416307534_40f6616283_o.jpg', 'Nature - 3416307534_40f6616283_o.jpg image',  '2009-12-18', 3, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 61);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (109, '1985-01-08', 'Beautiful colours. Nice close up. ',61, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (110, '1985-01-08', 'Beautiful colours. Nice close up. ',61, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (111, '1985-01-08', 'Amazing shot..',61, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (112, '1985-01-08', 'Beautiful colours. Nice close up. ',61, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (62, '3416321407_068332d9f2_o.jpg', '3416321407_068332d9f2_o.jpg', 'Nature - 3416321407_068332d9f2_o.jpg image',  '2009-12-18', 3, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 62);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (113, '1985-01-08', 'fantastic shot !!!!!!',62, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (114, '1985-01-08', 'I Think this is Art!',62, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (63, '3416371116_f793561d19_o.jpg', '3416371116_f793561d19_o.jpg', 'Nature - 3416371116_f793561d19_o.jpg image',  '2009-12-18', 3, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 63);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (115, '1985-01-08', 'fantastic shot !!!!!!',63, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (64, '3417131300_2aac5ec32c_o.jpg', '3417131300_2aac5ec32c_o.jpg', 'Nature - 3417131300_2aac5ec32c_o.jpg image',  '2009-12-18', 3, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 64);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (116, '1985-01-08', 'love every thing about this picture, really beautiful... :))',64, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (117, '1985-01-08', 'Beautiful colours. Nice close up. ',64, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (65, '3417132360_56d0b48a9d_o.jpg', '3417132360_56d0b48a9d_o.jpg', 'Nature - 3417132360_56d0b48a9d_o.jpg image',  '2009-12-18', 3, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 65);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (118, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',65, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (119, '1985-01-08', 'Such a lovely colour azaga!',65, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (66, '3417319507_8d1f2d5c77_o.jpg', '3417319507_8d1f2d5c77_o.jpg', 'Nature - 3417319507_8d1f2d5c77_o.jpg image',  '2009-12-18', 3, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 66);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (120, '1985-01-08', 'that is a beautiful flower with great colours ',66, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (121, '1985-01-08', 'Amazing shot..',66, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (67, '3417494725_e21724aba9_o.jpg', '3417494725_e21724aba9_o.jpg', 'Nature - 3417494725_e21724aba9_o.jpg image',  '2009-12-18', 3, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 67);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (122, '1985-01-08', 'that is a beautiful flower with great colours ',67, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (68, '3418371942_a61ae58de4_o.jpg', '3418371942_a61ae58de4_o.jpg', 'Nature - 3418371942_a61ae58de4_o.jpg image',  '2009-12-18', 3, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 68);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (123, '1985-01-08', 'Amazing shot..',68, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (124, '1985-01-08', 'fantastic shot !!!!!!',68, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (125, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',68, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (126, '1985-01-08', 'Wonderful.',68, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (69, '345009210_1f826cd5a1_o.jpg', '345009210_1f826cd5a1_o.jpg', 'Nature - 345009210_1f826cd5a1_o.jpg image',  '2009-12-18', 3, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 69);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (70, '55109059_55408b3d5f_o.jpg', '55109059_55408b3d5f_o.jpg', 'Nature - 55109059_55408b3d5f_o.jpg image',  '2009-12-18', 3, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 70);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (127, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',70, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (128, '1985-01-08', 'Bellísima.!!! saludos.',70, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (129, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',70, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (130, '1985-01-08', 'Stunning capture! :-)',70, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (71, '570841724_b11c8b0df2_o.jpg', '570841724_b11c8b0df2_o.jpg', 'Nature - 570841724_b11c8b0df2_o.jpg image',  '2009-12-18', 3, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 71);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (131, '1985-01-08', 'Bellísima.!!! saludos.',71, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (72, '672840660_4a91f39f02_o.jpg', '672840660_4a91f39f02_o.jpg', 'Nature - 672840660_4a91f39f02_o.jpg image',  '2009-12-18', 3, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 72);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (132, '1985-01-08', 'that is a beautiful flower with great colours ',72, 3);
+UPDATE Album set coveringImage_id=72 where id = 3;
 
 ---------------------------------------------------------------------
 -- ALBUM - Portrait"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (4, 'Portrait', 'Portrait pictures',  3, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (4,  'Portrait');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (4, 'Portrait', 'Portrait pictures',  3, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (4,  'Portrait');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (73, '02[303x202].jpg', '02[303x202].jpg', 'Portrait - 02[303x202].jpg image',  '2009-12-18', 4, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 73);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (134, '1985-01-08', 'Wonderful.',73, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (135, '1985-01-08', 'Beautiful colours. Nice close up. ',73, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (136, '1985-01-08', 'Perfecft!',73, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (137, '1985-01-08', 'that is a beautiful flower with great colours ',73, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (74, '1033975999_7e058fcf1c_o.jpg', '1033975999_7e058fcf1c_o.jpg', 'Portrait - 1033975999_7e058fcf1c_o.jpg image',  '2009-12-18', 4, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 74);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (138, '1985-01-08', 'this is extremely Good:) Congratulations!',74, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (75, '1516027705_ddff0a70dd_o.jpg', '1516027705_ddff0a70dd_o.jpg', 'Portrait - 1516027705_ddff0a70dd_o.jpg image',  '2009-12-18', 4, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 75);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (139, '1985-01-08', '++Beautiful',75, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (76, '1799039821_b6ee53167c_o.jpg', '1799039821_b6ee53167c_o.jpg', 'Portrait - 1799039821_b6ee53167c_o.jpg image',  '2009-12-18', 4, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 76);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (140, '1985-01-08', 'Stunning capture! :-)',76, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (77, '19654343_f445e1efa2_o.jpg', '19654343_f445e1efa2_o.jpg', 'Portrait - 19654343_f445e1efa2_o.jpg image',  '2009-12-18', 4, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 77);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (141, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',77, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (142, '1985-01-08', 'this is extremely Good:) Congratulations!',77, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (143, '1985-01-08', 'Beautiful colours. Nice close up. ',77, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (78, '2187016030_e81b911b3e_o.jpg', '2187016030_e81b911b3e_o.jpg', 'Portrait - 2187016030_e81b911b3e_o.jpg image',  '2009-12-18', 4, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 78);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (79, '2307649188_a6206c17a4_o.jpg', '2307649188_a6206c17a4_o.jpg', 'Portrait - 2307649188_a6206c17a4_o.jpg image',  '2009-12-18', 4, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 79);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (144, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',79, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (80, '2879155528_1ebbaaf951_o.jpg', '2879155528_1ebbaaf951_o.jpg', 'Portrait - 2879155528_1ebbaaf951_o.jpg image',  '2009-12-18', 4, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 80);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (81, '2933904745_b323535d4a_o.jpg', '2933904745_b323535d4a_o.jpg', 'Portrait - 2933904745_b323535d4a_o.jpg image',  '2009-12-18', 4, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 81);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (145, '1985-01-08', 'Very *lovely*',81, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (146, '1985-01-08', '++Beautiful',81, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (147, '1985-01-08', 'Bellísima.!!! saludos.',81, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (82, '3-3.jpg', '3-3.jpg', 'Portrait - 3-3.jpg image',  '2009-12-18', 4, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 82);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (148, '1985-01-08', 'that is a beautiful flower with great colours ',82, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (149, '1985-01-08', 'this is extremely Good:) Congratulations!',82, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (83, '3176975826_ef29a459fa_o.jpg', '3176975826_ef29a459fa_o.jpg', 'Portrait - 3176975826_ef29a459fa_o.jpg image',  '2009-12-18', 4, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 83);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (150, '1985-01-08', 'Bellísima.!!! saludos.',83, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (151, '1985-01-08', 'Bellísima.!!! saludos.',83, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (84, '323301225_3aef765e5a_o.jpg', '323301225_3aef765e5a_o.jpg', 'Portrait - 323301225_3aef765e5a_o.jpg image',  '2009-12-18', 4, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 84);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (152, '1985-01-08', 'Gorgeous! Lovely color!',84, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (153, '1985-01-08', 'love every thing about this picture, really beautiful... :))',84, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (154, '1985-01-08', 'whoah ! wonderful',84, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (85, 'img_0103.jpg', 'img_0103.jpg', 'Portrait - img_0103.jpg image',  '2009-12-18', 4, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 85);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (155, '1985-01-08', 'Very *lovely*',85, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (156, '1985-01-08', 'fantastic shot !!!!!!',85, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (86, '_mg_0161.jpg', '_mg_0161.jpg', 'Portrait - _mg_0161.jpg image',  '2009-12-18', 4, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 86);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (157, '1985-01-08', '++Beautiful',86, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (158, '1985-01-08', 'whoah ! wonderful',86, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (87, '_mg_0264.jpg', '_mg_0264.jpg', 'Portrait - _mg_0264.jpg image',  '2009-12-18', 4, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 87);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (159, '1985-01-08', 'Such a lovely colour azaga!',87, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (88, '_mg_0510.jpg', '_mg_0510.jpg', 'Portrait - _mg_0510.jpg image',  '2009-12-18', 4, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 88);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (160, '1985-01-08', 'fantastic shot !!!!!!',88, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (161, '1985-01-08', 'this is extremely Good:) Congratulations!',88, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (162, '1985-01-08', 'Wonderful.',88, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (89, '_mg_1788.jpg', '_mg_1788.jpg', 'Portrait - _mg_1788.jpg image',  '2009-12-18', 4, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 89);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (163, '1985-01-08', 'that is a beautiful flower with great colours ',89, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (164, '1985-01-08', 'Gorgeous! Lovely color!',89, 1);
-UPDATE albums set coveringimage_image_id=89 where album_id = 4;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (73, '02[303x202].jpg', '02[303x202].jpg', 'Portrait - 02[303x202].jpg image',  '2009-12-18', 4, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 73);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (133, '1985-01-08', 'Beautiful colours. Nice close up. ',73, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (134, '1985-01-08', 'Such a lovely colour azaga!',73, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (74, '1033975999_7e058fcf1c_o.jpg', '1033975999_7e058fcf1c_o.jpg', 'Portrait - 1033975999_7e058fcf1c_o.jpg image',  '2009-12-18', 4, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 74);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (135, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',74, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (75, '1516027705_ddff0a70dd_o.jpg', '1516027705_ddff0a70dd_o.jpg', 'Portrait - 1516027705_ddff0a70dd_o.jpg image',  '2009-12-18', 4, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 75);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (136, '1985-01-08', 'nice shot =) ',75, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (137, '1985-01-08', 'Beautiful colours. Nice close up. ',75, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (138, '1985-01-08', 'Bellissima macro!',75, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (139, '1985-01-08', 'Beautiful colours. Nice close up. ',75, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (76, '1799039821_b6ee53167c_o.jpg', '1799039821_b6ee53167c_o.jpg', 'Portrait - 1799039821_b6ee53167c_o.jpg image',  '2009-12-18', 4, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 76);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (140, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',76, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (141, '1985-01-08', 'Bellissima macro!',76, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (142, '1985-01-08', 'I Think this is Art!',76, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (77, '19654343_f445e1efa2_o.jpg', '19654343_f445e1efa2_o.jpg', 'Portrait - 19654343_f445e1efa2_o.jpg image',  '2009-12-18', 4, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 77);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (143, '1985-01-08', 'Such a lovely colour azaga!',77, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (144, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',77, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (145, '1985-01-08', 'Beautiful colours. Nice close up. ',77, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (78, '2187016030_e81b911b3e_o.jpg', '2187016030_e81b911b3e_o.jpg', 'Portrait - 2187016030_e81b911b3e_o.jpg image',  '2009-12-18', 4, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 78);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (79, '2307649188_a6206c17a4_o.jpg', '2307649188_a6206c17a4_o.jpg', 'Portrait - 2307649188_a6206c17a4_o.jpg image',  '2009-12-18', 4, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 79);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (146, '1985-01-08', 'whoah ! wonderful',79, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (147, '1985-01-08', 'nice shot =) ',79, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (148, '1985-01-08', 'this is extremely Good:) Congratulations!',79, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (149, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',79, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (80, '2879155528_1ebbaaf951_o.jpg', '2879155528_1ebbaaf951_o.jpg', 'Portrait - 2879155528_1ebbaaf951_o.jpg image',  '2009-12-18', 4, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 80);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (150, '1985-01-08', 'Such a lovely colour azaga!',80, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (151, '1985-01-08', 'Such a lovely colour azaga!',80, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (152, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',80, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (153, '1985-01-08', 'that is a beautiful flower with great colours ',80, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (81, '2933904745_b323535d4a_o.jpg', '2933904745_b323535d4a_o.jpg', 'Portrait - 2933904745_b323535d4a_o.jpg image',  '2009-12-18', 4, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 81);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (154, '1985-01-08', 'this is extremely Good:) Congratulations!',81, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (155, '1985-01-08', 'nice shot =) ',81, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (156, '1985-01-08', 'Beautiful colours. Nice close up. ',81, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (157, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',81, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (82, '3-3.jpg', '3-3.jpg', 'Portrait - 3-3.jpg image',  '2009-12-18', 4, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 82);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (158, '1985-01-08', 'that is a beautiful flower with great colours ',82, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (159, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',82, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (160, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',82, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (83, '3176975826_ef29a459fa_o.jpg', '3176975826_ef29a459fa_o.jpg', 'Portrait - 3176975826_ef29a459fa_o.jpg image',  '2009-12-18', 4, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 83);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (161, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',83, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (162, '1985-01-08', 'fantastic shot !!!!!!',83, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (163, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',83, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (164, '1985-01-08', 'fantastic shot !!!!!!',83, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (84, '323301225_3aef765e5a_o.jpg', '323301225_3aef765e5a_o.jpg', 'Portrait - 323301225_3aef765e5a_o.jpg image',  '2009-12-18', 4, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 84);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (165, '1985-01-08', 'Wonderful.',84, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (166, '1985-01-08', 'love every thing about this picture, really beautiful... :))',84, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (167, '1985-01-08', 'fantastic shot !!!!!!',84, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (85, 'img_0103.jpg', 'img_0103.jpg', 'Portrait - img_0103.jpg image',  '2009-12-18', 4, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 85);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (86, '_mg_0161.jpg', '_mg_0161.jpg', 'Portrait - _mg_0161.jpg image',  '2009-12-18', 4, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 86);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (168, '1985-01-08', 'I Think this is Art!',86, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (87, '_mg_0264.jpg', '_mg_0264.jpg', 'Portrait - _mg_0264.jpg image',  '2009-12-18', 4, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 87);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (169, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',87, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (170, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',87, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (88, '_mg_0510.jpg', '_mg_0510.jpg', 'Portrait - _mg_0510.jpg image',  '2009-12-18', 4, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 88);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (171, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',88, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (172, '1985-01-08', 'nice shot =) ',88, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (89, '_mg_1788.jpg', '_mg_1788.jpg', 'Portrait - _mg_1788.jpg image',  '2009-12-18', 4, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 89);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (173, '1985-01-08', 'Stunning capture! :-)',89, 1);
+UPDATE Album set coveringImage_id=89 where id = 4;
 
 ---------------------------------------------------------------------
 -- ALBUM - Sport"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (5, 'Sport', 'Sport pictures',  4, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (5,  'Sport');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (5, 'Sport', 'Sport pictures',  4, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (5,  'Sport');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (90, '103193233_860c47c909_o.jpg', '103193233_860c47c909_o.jpg', 'Sport - 103193233_860c47c909_o.jpg image',  '2009-12-18', 5, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 90);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (165, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',90, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (166, '1985-01-08', 'I Think this is Art!',90, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (167, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',90, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (168, '1985-01-08', 'fantastic shot !!!!!!',90, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (91, '1350250361_2d963dd4e7_o.jpg', '1350250361_2d963dd4e7_o.jpg', 'Sport - 1350250361_2d963dd4e7_o.jpg image',  '2009-12-18', 5, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 91);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (169, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',91, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (170, '1985-01-08', 'Gorgeous! Lovely color!',91, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (171, '1985-01-08', 'Beautiful colours. Nice close up. ',91, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (172, '1985-01-08', 'whoah ! wonderful',91, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (92, '2042654579_d25c0db64f_o.jpg', '2042654579_d25c0db64f_o.jpg', 'Sport - 2042654579_d25c0db64f_o.jpg image',  '2009-12-18', 5, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 92);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (173, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',92, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (174, '1985-01-08', 'Gorgeous! Lovely color!',92, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (93, '2158910844_e5a6deeeab_o.jpg', '2158910844_e5a6deeeab_o.jpg', 'Sport - 2158910844_e5a6deeeab_o.jpg image',  '2009-12-18', 5, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 93);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (175, '1985-01-08', 'whoah ! wonderful',93, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (176, '1985-01-08', 'Bellissima macro!',93, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (177, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',93, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (94, '2228156682_74520fa2e5_o.jpg', '2228156682_74520fa2e5_o.jpg', 'Sport - 2228156682_74520fa2e5_o.jpg image',  '2009-12-18', 5, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 94);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (178, '1985-01-08', 'Perfecft!',94, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (95, '2264670815_82c5619ec6_o.jpg', '2264670815_82c5619ec6_o.jpg', 'Sport - 2264670815_82c5619ec6_o.jpg image',  '2009-12-18', 5, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 95);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (179, '1985-01-08', 'that is a beautiful flower with great colours ',95, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (180, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',95, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (181, '1985-01-08', 'that is a beautiful flower with great colours ',95, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (182, '1985-01-08', '++Beautiful',95, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (96, '2266019996_6b7fcb9d41_o.jpg', '2266019996_6b7fcb9d41_o.jpg', 'Sport - 2266019996_6b7fcb9d41_o.jpg image',  '2009-12-18', 5, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 96);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (183, '1985-01-08', 'fantastic shot !!!!!!',96, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (97, '2338319633_4feac41833_o.jpg', '2338319633_4feac41833_o.jpg', 'Sport - 2338319633_4feac41833_o.jpg image',  '2009-12-18', 5, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 97);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (184, '1985-01-08', 'this is extremely Good:) Congratulations!',97, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (98, '2541626690_d6c35f7122_o.jpg', '2541626690_d6c35f7122_o.jpg', 'Sport - 2541626690_d6c35f7122_o.jpg image',  '2009-12-18', 5, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 98);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (99, '2760610141_8a56e469d0_o.jpg', '2760610141_8a56e469d0_o.jpg', 'Sport - 2760610141_8a56e469d0_o.jpg image',  '2009-12-18', 5, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 99);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (185, '1985-01-08', 'whoah ! wonderful',99, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (186, '1985-01-08', 'I Think this is Art!',99, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (100, '2767537621_e378165405_o.jpg', '2767537621_e378165405_o.jpg', 'Sport - 2767537621_e378165405_o.jpg image',  '2009-12-18', 5, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 100);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (101, '2813129574_018acd119d_o.jpg', '2813129574_018acd119d_o.jpg', 'Sport - 2813129574_018acd119d_o.jpg image',  '2009-12-18', 5, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 101);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (187, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',101, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (102, '2832747707_fb68c8147f_o.jpg', '2832747707_fb68c8147f_o.jpg', 'Sport - 2832747707_fb68c8147f_o.jpg image',  '2009-12-18', 5, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 102);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (188, '1985-01-08', 'fantastic shot !!!!!!',102, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (189, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',102, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (190, '1985-01-08', 'Such a lovely colour azaga!',102, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (191, '1985-01-08', 'Stunning capture! :-)',102, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (103, '3037432738_e4b2388861_o.jpg', '3037432738_e4b2388861_o.jpg', 'Sport - 3037432738_e4b2388861_o.jpg image',  '2009-12-18', 5, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 103);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (192, '1985-01-08', 'Wonderful.',103, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (104, '413103429_50ff9d8ae3_o.jpg', '413103429_50ff9d8ae3_o.jpg', 'Sport - 413103429_50ff9d8ae3_o.jpg image',  '2009-12-18', 5, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 104);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (193, '1985-01-08', 'love every thing about this picture, really beautiful... :))',104, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (194, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',104, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (195, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',104, 2);
-UPDATE albums set coveringimage_image_id=104 where album_id = 5;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (90, '103193233_860c47c909_o.jpg', '103193233_860c47c909_o.jpg', 'Sport - 103193233_860c47c909_o.jpg image',  '2009-12-18', 5, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 90);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (174, '1985-01-08', 'Beautiful colours. Nice close up. ',90, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (175, '1985-01-08', 'Wonderful.',90, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (176, '1985-01-08', 'fantastic shot !!!!!!',90, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (177, '1985-01-08', 'fantastic shot !!!!!!',90, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (91, '1350250361_2d963dd4e7_o.jpg', '1350250361_2d963dd4e7_o.jpg', 'Sport - 1350250361_2d963dd4e7_o.jpg image',  '2009-12-18', 5, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 91);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (178, '1985-01-08', 'Such a lovely colour azaga!',91, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (92, '2042654579_d25c0db64f_o.jpg', '2042654579_d25c0db64f_o.jpg', 'Sport - 2042654579_d25c0db64f_o.jpg image',  '2009-12-18', 5, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 92);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (179, '1985-01-08', 'Gorgeous! Lovely color!',92, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (93, '2158910844_e5a6deeeab_o.jpg', '2158910844_e5a6deeeab_o.jpg', 'Sport - 2158910844_e5a6deeeab_o.jpg image',  '2009-12-18', 5, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 93);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (180, '1985-01-08', 'Wonderful.',93, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (181, '1985-01-08', 'Wonderful.',93, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (182, '1985-01-08', 'I Think this is Art!',93, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (94, '2228156682_74520fa2e5_o.jpg', '2228156682_74520fa2e5_o.jpg', 'Sport - 2228156682_74520fa2e5_o.jpg image',  '2009-12-18', 5, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 94);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (183, '1985-01-08', 'whoah ! wonderful',94, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (184, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',94, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (185, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',94, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (95, '2264670815_82c5619ec6_o.jpg', '2264670815_82c5619ec6_o.jpg', 'Sport - 2264670815_82c5619ec6_o.jpg image',  '2009-12-18', 5, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 95);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (186, '1985-01-08', 'fantastic shot !!!!!!',95, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (187, '1985-01-08', 'I Think this is Art!',95, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (96, '2266019996_6b7fcb9d41_o.jpg', '2266019996_6b7fcb9d41_o.jpg', 'Sport - 2266019996_6b7fcb9d41_o.jpg image',  '2009-12-18', 5, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 96);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (188, '1985-01-08', 'Beautiful colours. Nice close up. ',96, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (189, '1985-01-08', 'Bellísima.!!! saludos.',96, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (190, '1985-01-08', '++Beautiful',96, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (191, '1985-01-08', 'Wonderful.',96, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (97, '2338319633_4feac41833_o.jpg', '2338319633_4feac41833_o.jpg', 'Sport - 2338319633_4feac41833_o.jpg image',  '2009-12-18', 5, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 97);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (192, '1985-01-08', 'Amazing shot..',97, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (98, '2541626690_d6c35f7122_o.jpg', '2541626690_d6c35f7122_o.jpg', 'Sport - 2541626690_d6c35f7122_o.jpg image',  '2009-12-18', 5, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 98);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (99, '2760610141_8a56e469d0_o.jpg', '2760610141_8a56e469d0_o.jpg', 'Sport - 2760610141_8a56e469d0_o.jpg image',  '2009-12-18', 5, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 99);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (100, '2767537621_e378165405_o.jpg', '2767537621_e378165405_o.jpg', 'Sport - 2767537621_e378165405_o.jpg image',  '2009-12-18', 5, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 100);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (101, '2813129574_018acd119d_o.jpg', '2813129574_018acd119d_o.jpg', 'Sport - 2813129574_018acd119d_o.jpg image',  '2009-12-18', 5, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 101);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (102, '2832747707_fb68c8147f_o.jpg', '2832747707_fb68c8147f_o.jpg', 'Sport - 2832747707_fb68c8147f_o.jpg image',  '2009-12-18', 5, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 102);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (193, '1985-01-08', 'I Think this is Art!',102, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (194, '1985-01-08', 'nice shot =) ',102, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (195, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',102, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (103, '3037432738_e4b2388861_o.jpg', '3037432738_e4b2388861_o.jpg', 'Sport - 3037432738_e4b2388861_o.jpg image',  '2009-12-18', 5, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 103);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (196, '1985-01-08', 'Perfecft!',103, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (104, '413103429_50ff9d8ae3_o.jpg', '413103429_50ff9d8ae3_o.jpg', 'Sport - 413103429_50ff9d8ae3_o.jpg image',  '2009-12-18', 5, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 104);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (197, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',104, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (198, '1985-01-08', 'Amazing shot..',104, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (199, '1985-01-08', 'Bellísima.!!! saludos.',104, 1);
+UPDATE Album set coveringImage_id=104 where id = 5;
 
 ---------------------------------------------------------------------
 -- ALBUM - Water"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (6, 'Water', 'Water pictures',  1, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (6,  'Water');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (6, 'Water', 'Water pictures',  1, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (6,  'Water');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (105, '117215467_5cccef9aaa_b.jpg', '117215467_5cccef9aaa_b.jpg', 'Water - 117215467_5cccef9aaa_b.jpg image',  '2009-12-18', 6, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 105);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (106, '1323769314_fe850cd954_o.jpg', '1323769314_fe850cd954_o.jpg', 'Water - 1323769314_fe850cd954_o.jpg image',  '2009-12-18', 6, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 106);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (196, '1985-01-08', 'Bellísima.!!! saludos.',106, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (107, '205579493_baf0f850d1_o.jpg', '205579493_baf0f850d1_o.jpg', 'Water - 205579493_baf0f850d1_o.jpg image',  '2009-12-18', 6, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 107);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (197, '1985-01-08', 'Wonderful.',107, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (198, '1985-01-08', 'I Think this is Art!',107, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (199, '1985-01-08', 'Amazing shot..',107, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (200, '1985-01-08', 'Gorgeous! Lovely color!',107, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (108, '2198502835_1644c8fde2_o.jpg', '2198502835_1644c8fde2_o.jpg', 'Water - 2198502835_1644c8fde2_o.jpg image',  '2009-12-18', 6, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 108);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (201, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',108, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (202, '1985-01-08', 'I Think this is Art!',108, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (203, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',108, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (204, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',108, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (109, '2242254221_f2af58e243_o.jpg', '2242254221_f2af58e243_o.jpg', 'Water - 2242254221_f2af58e243_o.jpg image',  '2009-12-18', 6, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 109);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (205, '1985-01-08', 'nice shot =) ',109, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (110, '3170219697_4d259ff802_o.jpg', '3170219697_4d259ff802_o.jpg', 'Water - 3170219697_4d259ff802_o.jpg image',  '2009-12-18', 6, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 110);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (206, '1985-01-08', 'Bellísima.!!! saludos.',110, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (207, '1985-01-08', 'I Think this is Art!',110, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (111, '3200123361_cfd16bb12a_o.jpg', '3200123361_cfd16bb12a_o.jpg', 'Water - 3200123361_cfd16bb12a_o.jpg image',  '2009-12-18', 6, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 111);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (208, '1985-01-08', 'Bellissima macro!',111, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (112, '3253676430_b14ae3f5c9_o.jpg', '3253676430_b14ae3f5c9_o.jpg', 'Water - 3253676430_b14ae3f5c9_o.jpg image',  '2009-12-18', 6, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 112);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (209, '1985-01-08', '++Beautiful',112, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (113, '336589255_6a8ba0ebb6_o.jpg', '336589255_6a8ba0ebb6_o.jpg', 'Water - 336589255_6a8ba0ebb6_o.jpg image',  '2009-12-18', 6, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 113);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (210, '1985-01-08', 'Gorgeous! Lovely color!',113, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (211, '1985-01-08', 'I Think this is Art!',113, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (212, '1985-01-08', 'I Think this is Art!',113, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (114, '3411135019_0cc403fcb8_o.jpg', '3411135019_0cc403fcb8_o.jpg', 'Water - 3411135019_0cc403fcb8_o.jpg image',  '2009-12-18', 6, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 114);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (213, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',114, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (214, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',114, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (215, '1985-01-08', 'Wonderful.',114, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (115, '3416553183_2564d26ef1_b.jpg', '3416553183_2564d26ef1_b.jpg', 'Water - 3416553183_2564d26ef1_b.jpg image',  '2009-12-18', 6, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 115);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (216, '1985-01-08', 'whoah ! wonderful',115, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (217, '1985-01-08', 'that is a beautiful flower with great colours ',115, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (218, '1985-01-08', 'nice shot =) ',115, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (219, '1985-01-08', 'Perfecft!',115, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (116, '381634787_f52e84a5af_o.jpg', '381634787_f52e84a5af_o.jpg', 'Water - 381634787_f52e84a5af_o.jpg image',  '2009-12-18', 6, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 116);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (117, '396318116_a47c4a8392_o.jpg', '396318116_a47c4a8392_o.jpg', 'Water - 396318116_a47c4a8392_o.jpg image',  '2009-12-18', 6, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 117);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (220, '1985-01-08', 'that is a beautiful flower with great colours ',117, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (118, '412426470_47be44c1f1_o.jpg', '412426470_47be44c1f1_o.jpg', 'Water - 412426470_47be44c1f1_o.jpg image',  '2009-12-18', 6, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 118);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (119, '7530427_08dcad5953_o.jpg', '7530427_08dcad5953_o.jpg', 'Water - 7530427_08dcad5953_o.jpg image',  '2009-12-18', 6, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 119);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (221, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',119, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (222, '1985-01-08', 'Very *lovely*',119, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (120, '767963055_bd02f406d6_o.jpg', '767963055_bd02f406d6_o.jpg', 'Water - 767963055_bd02f406d6_o.jpg image',  '2009-12-18', 6, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 120);
-UPDATE albums set coveringimage_image_id=120 where album_id = 6;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (105, '117215467_5cccef9aaa_b.jpg', '117215467_5cccef9aaa_b.jpg', 'Water - 117215467_5cccef9aaa_b.jpg image',  '2009-12-18', 6, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 105);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (200, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',105, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (106, '1323769314_fe850cd954_o.jpg', '1323769314_fe850cd954_o.jpg', 'Water - 1323769314_fe850cd954_o.jpg image',  '2009-12-18', 6, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 106);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (201, '1985-01-08', 'this is extremely Good:) Congratulations!',106, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (202, '1985-01-08', 'nice shot =) ',106, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (203, '1985-01-08', 'Very *lovely*',106, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (107, '205579493_baf0f850d1_o.jpg', '205579493_baf0f850d1_o.jpg', 'Water - 205579493_baf0f850d1_o.jpg image',  '2009-12-18', 6, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 107);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (204, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',107, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (108, '2198502835_1644c8fde2_o.jpg', '2198502835_1644c8fde2_o.jpg', 'Water - 2198502835_1644c8fde2_o.jpg image',  '2009-12-18', 6, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 108);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (205, '1985-01-08', 'Wonderful.',108, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (109, '2242254221_f2af58e243_o.jpg', '2242254221_f2af58e243_o.jpg', 'Water - 2242254221_f2af58e243_o.jpg image',  '2009-12-18', 6, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 109);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (206, '1985-01-08', 'Bellissima macro!',109, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (207, '1985-01-08', 'Very *lovely*',109, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (208, '1985-01-08', 'Bellísima.!!! saludos.',109, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (110, '3170219697_4d259ff802_o.jpg', '3170219697_4d259ff802_o.jpg', 'Water - 3170219697_4d259ff802_o.jpg image',  '2009-12-18', 6, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 110);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (209, '1985-01-08', 'Stunning capture! :-)',110, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (111, '3200123361_cfd16bb12a_o.jpg', '3200123361_cfd16bb12a_o.jpg', 'Water - 3200123361_cfd16bb12a_o.jpg image',  '2009-12-18', 6, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 111);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (210, '1985-01-08', 'that is a beautiful flower with great colours ',111, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (211, '1985-01-08', 'Gorgeous! Lovely color!',111, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (112, '3253676430_b14ae3f5c9_o.jpg', '3253676430_b14ae3f5c9_o.jpg', 'Water - 3253676430_b14ae3f5c9_o.jpg image',  '2009-12-18', 6, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 112);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (212, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',112, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (213, '1985-01-08', 'Beautiful colours. Nice close up. ',112, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (214, '1985-01-08', 'Perfecft!',112, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (215, '1985-01-08', 'Amazing shot..',112, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (113, '336589255_6a8ba0ebb6_o.jpg', '336589255_6a8ba0ebb6_o.jpg', 'Water - 336589255_6a8ba0ebb6_o.jpg image',  '2009-12-18', 6, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 113);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (216, '1985-01-08', 'nice shot =) ',113, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (217, '1985-01-08', 'that is a beautiful flower with great colours ',113, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (218, '1985-01-08', 'Amazing shot..',113, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (114, '3411135019_0cc403fcb8_o.jpg', '3411135019_0cc403fcb8_o.jpg', 'Water - 3411135019_0cc403fcb8_o.jpg image',  '2009-12-18', 6, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 114);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (219, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',114, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (115, '3416553183_2564d26ef1_b.jpg', '3416553183_2564d26ef1_b.jpg', 'Water - 3416553183_2564d26ef1_b.jpg image',  '2009-12-18', 6, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 115);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (116, '381634787_f52e84a5af_o.jpg', '381634787_f52e84a5af_o.jpg', 'Water - 381634787_f52e84a5af_o.jpg image',  '2009-12-18', 6, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 116);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (220, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',116, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (221, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',116, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (222, '1985-01-08', 'Very *lovely*',116, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (117, '396318116_a47c4a8392_o.jpg', '396318116_a47c4a8392_o.jpg', 'Water - 396318116_a47c4a8392_o.jpg image',  '2009-12-18', 6, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 117);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (118, '412426470_47be44c1f1_o.jpg', '412426470_47be44c1f1_o.jpg', 'Water - 412426470_47be44c1f1_o.jpg image',  '2009-12-18', 6, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 118);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (223, '1985-01-08', 'Such a lovely colour azaga!',118, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (224, '1985-01-08', 'Such a lovely colour azaga!',118, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (225, '1985-01-08', 'whoah ! wonderful',118, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (119, '7530427_08dcad5953_o.jpg', '7530427_08dcad5953_o.jpg', 'Water - 7530427_08dcad5953_o.jpg image',  '2009-12-18', 6, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 119);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (226, '1985-01-08', 'nice shot =) ',119, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (227, '1985-01-08', 'I Think this is Art!',119, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (228, '1985-01-08', 'Such a lovely colour azaga!',119, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (120, '767963055_bd02f406d6_o.jpg', '767963055_bd02f406d6_o.jpg', 'Water - 767963055_bd02f406d6_o.jpg image',  '2009-12-18', 6, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 120);
+UPDATE Album set coveringImage_id=120 where id = 6;
 

Modified: trunk/examples/photoalbum/ejb/sql/short/import.sql
===================================================================
--- trunk/examples/photoalbum/ejb/sql/short/import.sql	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/sql/short/import.sql	2009-04-25 14:32:30 UTC (rev 13863)
@@ -1,169 +1,170 @@
-INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (1,  'Andrey', 'Markhel', 'amarkhel at exadel.com',  'amarkhel', '8cb2237d0679ca88db6464eac60da96345513964',  '1985-01-08', 0, 0, true);
-INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (2,  'Nick',   'Curtis',  'nkurtis at iba.com',      'Viking',   '8cb2237d0679ca88db6464eac60da96345513964',  '1978-01-08', 1, 0, true);
-INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (3,  'John',   'Smith',   'jsmith at jboss.com',     'Noname',   '8cb2237d0679ca88db6464eac60da96345513964',  '1970-01-08', 1, 0, true);
+INSERT INTO User(id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (1,  'Andrey', 'Markhel', 'amarkhel at exadel.com',  'amarkhel', '8cb2237d0679ca88db6464eac60da96345513964',  '1985-01-08', 0, 0, true);
+INSERT INTO User(id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (2,  'Nick',   'Curtis',  'nkurtis at iba.com',      'Viking',   '8cb2237d0679ca88db6464eac60da96345513964',  '1978-01-08', 1, 0, true);
+INSERT INTO User(id, firstname, secondname, email, login, passwordHash, birthdate, sex, hasAvatar, preDefined) VALUES (3,  'John',   'Smith',   'jsmith at jboss.com',     'Noname',   '8cb2237d0679ca88db6464eac60da96345513964',  '1970-01-08', 1, 0, true);
 
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (1,  'Nature',  'Nature pictures',  1, '2009-12-18', true);
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (2,  'Sport',   'Nature pictures',  1, '2009-12-18', true);
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (3,  'Water',   'Nature pictures',  2, '2009-12-18', true);
-INSERT INTO shelves(shelf_id, name, description, user_id, created, shared) VALUES (4,  'Flowers', 'Nature pictures',  3, '2009-12-18', true);
+INSERT INTO Shelf(id, name, description, owner_id, created, shared) VALUES (1,  'Nature',  'Nature pictures',  1, '2009-12-18', true);
+INSERT INTO Shelf(id, name, description, owner_id, created, shared) VALUES (2,  'Sport',   'Nature pictures',  1, '2009-12-18', true);
+INSERT INTO Shelf(id, name, description, owner_id, created, shared) VALUES (3,  'Water',   'Nature pictures',  2, '2009-12-18', true);
+INSERT INTO Shelf(id, name, description, owner_id, created, shared) VALUES (4,  'Flowers', 'Nature pictures',  3, '2009-12-18', true);
 ---------------------------------------------------------------------
 -- ALBUM - Animals"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (0, 'Animals', 'Animals pictures',  1, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (0,  'Animals');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (0, 'Animals', 'Animals pictures',  1, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (0,  'Animals');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (0, '1750979205_6e51b47ce9_o.jpg', '1750979205_6e51b47ce9_o.jpg', 'Animals - 1750979205_6e51b47ce9_o.jpg image',  '2009-12-18', 0, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 0);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (0, '1985-01-08', 'love every thing about this picture, really beautiful... :))',0, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (1, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',0, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (2, '1985-01-08', 'that is a beautiful flower with great colours ',0, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (1, '1906662004_655d0f6ccf_o.jpg', '1906662004_655d0f6ccf_o.jpg', 'Animals - 1906662004_655d0f6ccf_o.jpg image',  '2009-12-18', 0, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (3, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',1, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (4, '1985-01-08', 'Bellísima.!!! saludos.',1, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (5, '1985-01-08', 'Bellissima macro!',1, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (6, '1985-01-08', 'Gorgeous! Lovely color!',1, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (2, '2090459727_f2888e5cbe_o.jpg', '2090459727_f2888e5cbe_o.jpg', 'Animals - 2090459727_f2888e5cbe_o.jpg image',  '2009-12-18', 0, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (7, '1985-01-08', 'I Think this is Art!',2, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (3, '2297752925_de29b5fb10_o.jpg', '2297752925_de29b5fb10_o.jpg', 'Animals - 2297752925_de29b5fb10_o.jpg image',  '2009-12-18', 0, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(0, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (8, '1985-01-08', 'Bellísima.!!! saludos.',3, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (9, '1985-01-08', 'fantastic shot !!!!!!',3, 2);
-UPDATE albums set coveringimage_image_id=3 where album_id = 0;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (0, '1750979205_6e51b47ce9_o.jpg', '1750979205_6e51b47ce9_o.jpg', 'Animals - 1750979205_6e51b47ce9_o.jpg image',  '2009-12-18', 0, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 0);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (1, '1906662004_655d0f6ccf_o.jpg', '1906662004_655d0f6ccf_o.jpg', 'Animals - 1906662004_655d0f6ccf_o.jpg image',  '2009-12-18', 0, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (0, '1985-01-08', 'Gorgeous! Lovely color!',1, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (2, '2090459727_f2888e5cbe_o.jpg', '2090459727_f2888e5cbe_o.jpg', 'Animals - 2090459727_f2888e5cbe_o.jpg image',  '2009-12-18', 0, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (1, '1985-01-08', 'Amazing shot..',2, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (2, '1985-01-08', 'Wonderful.',2, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (3, '1985-01-08', 'that is a beautiful flower with great colours ',2, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (4, '1985-01-08', 'Beautiful colours. Nice close up. ',2, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (3, '2297752925_de29b5fb10_o.jpg', '2297752925_de29b5fb10_o.jpg', 'Animals - 2297752925_de29b5fb10_o.jpg image',  '2009-12-18', 0, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(0, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (5, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',3, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (6, '1985-01-08', '++Beautiful',3, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (7, '1985-01-08', 'Gorgeous! Lovely color!',3, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (8, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',3, 1);
+UPDATE Album set coveringImage_id=3 where id = 0;
 
 ---------------------------------------------------------------------
 -- ALBUM - Cars"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (1, 'Cars', 'Cars pictures',  3, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (1,  'Cars');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (1, 'Cars', 'Cars pictures',  3, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (1,  'Cars');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (4, '190193308_ce2a4de5fa_o.jpg', '190193308_ce2a4de5fa_o.jpg', 'Cars - 190193308_ce2a4de5fa_o.jpg image',  '2009-12-18', 1, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 4);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (5, '1941230817_bcce17b8ef_o.jpg', '1941230817_bcce17b8ef_o.jpg', 'Cars - 1941230817_bcce17b8ef_o.jpg image',  '2009-12-18', 1, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 5);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (10, '1985-01-08', 'fantastic shot !!!!!!',5, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (6, '2151423750_129317a034_o.jpg', '2151423750_129317a034_o.jpg', 'Cars - 2151423750_129317a034_o.jpg image',  '2009-12-18', 1, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 6);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (11, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',6, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (12, '1985-01-08', 'Very *lovely*',6, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (7, '2233985073_9a3fd7d3ac_b.jpg', '2233985073_9a3fd7d3ac_b.jpg', 'Cars - 2233985073_9a3fd7d3ac_b.jpg image',  '2009-12-18', 1, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(1, 7);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (13, '1985-01-08', 'whoah ! wonderful',7, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (14, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',7, 1);
-UPDATE albums set coveringimage_image_id=7 where album_id = 1;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (4, '190193308_ce2a4de5fa_o.jpg', '190193308_ce2a4de5fa_o.jpg', 'Cars - 190193308_ce2a4de5fa_o.jpg image',  '2009-12-18', 1, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 4);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (5, '1941230817_bcce17b8ef_o.jpg', '1941230817_bcce17b8ef_o.jpg', 'Cars - 1941230817_bcce17b8ef_o.jpg image',  '2009-12-18', 1, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 5);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (9, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',5, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (10, '1985-01-08', 'nice shot =) ',5, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (11, '1985-01-08', 'nice shot =) ',5, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (12, '1985-01-08', 'Such a lovely colour azaga!',5, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (6, '2151423750_129317a034_o.jpg', '2151423750_129317a034_o.jpg', 'Cars - 2151423750_129317a034_o.jpg image',  '2009-12-18', 1, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 6);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (13, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',6, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (7, '2233985073_9a3fd7d3ac_b.jpg', '2233985073_9a3fd7d3ac_b.jpg', 'Cars - 2233985073_9a3fd7d3ac_b.jpg image',  '2009-12-18', 1, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(1, 7);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (14, '1985-01-08', 'Gorgeous! Lovely color!',7, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (15, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',7, 2);
+UPDATE Album set coveringImage_id=7 where id = 1;
 
 ---------------------------------------------------------------------
 -- ALBUM - Monuments and just buildings"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (2, 'Monuments and just buildings', 'Monuments and just buildings pictures',  4, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (2,  'Monuments and just buildings');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (2, 'Monuments and just buildings', 'Monuments and just buildings pictures',  4, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (2,  'Monuments and just buildings');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (8, '05[303x457].jpg', '05[303x457].jpg', 'Monuments and just buildings - 05[303x457].jpg image',  '2009-12-18', 2, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 8);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (9, '07[303x457].jpg', '07[303x457].jpg', 'Monuments and just buildings - 07[303x457].jpg image',  '2009-12-18', 2, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 9);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (15, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',9, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (10, '1805365000_ca64d20b10_o.jpg', '1805365000_ca64d20b10_o.jpg', 'Monuments and just buildings - 1805365000_ca64d20b10_o.jpg image',  '2009-12-18', 2, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 10);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (16, '1985-01-08', 'Amazing shot..',10, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (11, '1[303x457].jpg', '1[303x457].jpg', 'Monuments and just buildings - 1[303x457].jpg image',  '2009-12-18', 2, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(2, 11);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (17, '1985-01-08', 'Stunning capture! :-)',11, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (18, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',11, 3);
-UPDATE albums set coveringimage_image_id=11 where album_id = 2;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (8, '05[303x457].jpg', '05[303x457].jpg', 'Monuments and just buildings - 05[303x457].jpg image',  '2009-12-18', 2, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 8);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (9, '07[303x457].jpg', '07[303x457].jpg', 'Monuments and just buildings - 07[303x457].jpg image',  '2009-12-18', 2, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 9);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (10, '1805365000_ca64d20b10_o.jpg', '1805365000_ca64d20b10_o.jpg', 'Monuments and just buildings - 1805365000_ca64d20b10_o.jpg image',  '2009-12-18', 2, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 10);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (16, '1985-01-08', 'Bellísima.!!! saludos.',10, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (17, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',10, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (11, '1[303x457].jpg', '1[303x457].jpg', 'Monuments and just buildings - 1[303x457].jpg image',  '2009-12-18', 2, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(2, 11);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (18, '1985-01-08', '++Beautiful',11, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (19, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',11, 2);
+UPDATE Album set coveringImage_id=11 where id = 2;
 
 ---------------------------------------------------------------------
 -- ALBUM - Nature"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (3, 'Nature', 'Nature pictures',  2, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (3,  'Nature');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (3, 'Nature', 'Nature pictures',  2, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (3,  'Nature');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (12, '01[303x202].jpg', '01[303x202].jpg', 'Nature - 01[303x202].jpg image',  '2009-12-18', 3, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 12);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (19, '1985-01-08', 'Bellissima macro!',12, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (20, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',12, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (21, '1985-01-08', 'Bellísima.!!! saludos.',12, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (13, '1[305x457].jpg', '1[305x457].jpg', 'Nature - 1[305x457].jpg image',  '2009-12-18', 3, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 13);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (22, '1985-01-08', 'that is a beautiful flower with great colours ',13, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (23, '1985-01-08', 'Wonderful.',13, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (14, '273927725_c9f5ef5952_o.jpg', '273927725_c9f5ef5952_o.jpg', 'Nature - 273927725_c9f5ef5952_o.jpg image',  '2009-12-18', 3, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 14);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (24, '1985-01-08', 'Gorgeous! Lovely color!',14, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (15, '2[303x457].jpg', '2[303x457].jpg', 'Nature - 2[303x457].jpg image',  '2009-12-18', 3, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(3, 15);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (25, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',15, 3);
-UPDATE albums set coveringimage_image_id=15 where album_id = 3;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (12, '01[303x202].jpg', '01[303x202].jpg', 'Nature - 01[303x202].jpg image',  '2009-12-18', 3, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 12);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (13, '1[305x457].jpg', '1[305x457].jpg', 'Nature - 1[305x457].jpg image',  '2009-12-18', 3, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 13);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (20, '1985-01-08', 'Amazing shot..',13, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (21, '1985-01-08', 'Very *lovely*',13, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (22, '1985-01-08', 'Amazing shot..',13, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (14, '273927725_c9f5ef5952_o.jpg', '273927725_c9f5ef5952_o.jpg', 'Nature - 273927725_c9f5ef5952_o.jpg image',  '2009-12-18', 3, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 14);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (23, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',14, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (24, '1985-01-08', 'Beautiful colours. Nice close up. ',14, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (25, '1985-01-08', 'Bellissima macro!',14, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (26, '1985-01-08', 'Perfecft!',14, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (15, '2[303x457].jpg', '2[303x457].jpg', 'Nature - 2[303x457].jpg image',  '2009-12-18', 3, 'Canon PowerShot SX110 IS', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(3, 15);
+UPDATE Album set coveringImage_id=15 where id = 3;
 
 ---------------------------------------------------------------------
 -- ALBUM - Portrait"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (4, 'Portrait', 'Portrait pictures',  3, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (4,  'Portrait');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (4, 'Portrait', 'Portrait pictures',  3, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (4,  'Portrait');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (16, '02[303x202].jpg', '02[303x202].jpg', 'Portrait - 02[303x202].jpg image',  '2009-12-18', 4, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 16);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (26, '1985-01-08', 'fantastic shot !!!!!!',16, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (27, '1985-01-08', 'Beautiful ^Flower^...great Macro....Excellent !!!',16, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (28, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',16, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (29, '1985-01-08', 'Wonderful.',16, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (17, '1033975999_7e058fcf1c_o.jpg', '1033975999_7e058fcf1c_o.jpg', 'Portrait - 1033975999_7e058fcf1c_o.jpg image',  '2009-12-18', 4, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 17);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (30, '1985-01-08', 'I Think this is Art!',17, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (18, '1516027705_ddff0a70dd_o.jpg', '1516027705_ddff0a70dd_o.jpg', 'Portrait - 1516027705_ddff0a70dd_o.jpg image',  '2009-12-18', 4, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 18);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (19, '1799039821_b6ee53167c_o.jpg', '1799039821_b6ee53167c_o.jpg', 'Portrait - 1799039821_b6ee53167c_o.jpg image',  '2009-12-18', 4, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(4, 19);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (31, '1985-01-08', 'Bellísima.!!! saludos.',19, 2);
-UPDATE albums set coveringimage_image_id=19 where album_id = 4;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (16, '02[303x202].jpg', '02[303x202].jpg', 'Portrait - 02[303x202].jpg image',  '2009-12-18', 4, 'Nikon D60', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 16);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (17, '1033975999_7e058fcf1c_o.jpg', '1033975999_7e058fcf1c_o.jpg', 'Portrait - 1033975999_7e058fcf1c_o.jpg image',  '2009-12-18', 4, 'Sony Alpha DSLR-A350', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 17);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (27, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',17, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (18, '1516027705_ddff0a70dd_o.jpg', '1516027705_ddff0a70dd_o.jpg', 'Portrait - 1516027705_ddff0a70dd_o.jpg image',  '2009-12-18', 4, 'Canon Digital IXUS 80 IS (PowerShot SD1100 IS)', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 18);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (28, '1985-01-08', '|Wonderful| coloured flower .... *excellent* macro .... -nice- details!!!',18, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (19, '1799039821_b6ee53167c_o.jpg', '1799039821_b6ee53167c_o.jpg', 'Portrait - 1799039821_b6ee53167c_o.jpg image',  '2009-12-18', 4, 'Pentax Optio E40', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(4, 19);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (29, '1985-01-08', 'Fantastic job. Great light and color! Great shot!',19, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (30, '1985-01-08', 'this is extremely Good:) Congratulations!',19, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (31, '1985-01-08', 'Amazing shot..',19, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (32, '1985-01-08', 'this is extremely Good:) Congratulations!',19, 1);
+UPDATE Album set coveringImage_id=19 where id = 4;
 
 ---------------------------------------------------------------------
 -- ALBUM - Sport"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (5, 'Sport', 'Sport pictures',  4, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (5,  'Sport');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (5, 'Sport', 'Sport pictures',  4, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (5,  'Sport');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (20, '103193233_860c47c909_o.jpg', '103193233_860c47c909_o.jpg', 'Sport - 103193233_860c47c909_o.jpg image',  '2009-12-18', 5, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 20);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (32, '1985-01-08', 'this is extremely Good:) Congratulations!',20, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (33, '1985-01-08', 'whoah ! wonderful',20, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (34, '1985-01-08', 'nice shot =) ',20, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (35, '1985-01-08', 'Such a lovely colour azaga!',20, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (21, '1350250361_2d963dd4e7_o.jpg', '1350250361_2d963dd4e7_o.jpg', 'Sport - 1350250361_2d963dd4e7_o.jpg image',  '2009-12-18', 5, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 21);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (36, '1985-01-08', 'nice shot =) ',21, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (37, '1985-01-08', 'Stunning capture! :-)',21, 2);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (22, '2042654579_d25c0db64f_o.jpg', '2042654579_d25c0db64f_o.jpg', 'Sport - 2042654579_d25c0db64f_o.jpg image',  '2009-12-18', 5, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 22);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (38, '1985-01-08', 'nice shot =) ',22, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (39, '1985-01-08', 'Beautiful colours. Nice close up. ',22, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (23, '2158910844_e5a6deeeab_o.jpg', '2158910844_e5a6deeeab_o.jpg', 'Sport - 2158910844_e5a6deeeab_o.jpg image',  '2009-12-18', 5, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(5, 23);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (40, '1985-01-08', 'fantastic shot !!!!!!',23, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (41, '1985-01-08', 'Amazing shot..',23, 2);
-UPDATE albums set coveringimage_image_id=23 where album_id = 5;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (20, '103193233_860c47c909_o.jpg', '103193233_860c47c909_o.jpg', 'Sport - 103193233_860c47c909_o.jpg image',  '2009-12-18', 5, 'Olympus Stylus mju 1040', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 20);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (33, '1985-01-08', 'Such a lovely colour azaga!',20, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (34, '1985-01-08', 'Beautiful colours. Nice close up. ',20, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (35, '1985-01-08', 'Beautiful colours. Nice close up. ',20, 1);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (21, '1350250361_2d963dd4e7_o.jpg', '1350250361_2d963dd4e7_o.jpg', 'Sport - 1350250361_2d963dd4e7_o.jpg image',  '2009-12-18', 5, 'BBK DP810', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 21);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (22, '2042654579_d25c0db64f_o.jpg', '2042654579_d25c0db64f_o.jpg', 'Sport - 2042654579_d25c0db64f_o.jpg image',  '2009-12-18', 5, 'BenQ DC E800', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 22);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (23, '2158910844_e5a6deeeab_o.jpg', '2158910844_e5a6deeeab_o.jpg', 'Sport - 2158910844_e5a6deeeab_o.jpg image',  '2009-12-18', 5, 'Konica Minolta', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(5, 23);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (36, '1985-01-08', 'Perfecft!',23, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (37, '1985-01-08', 'fantastic shot !!!!!!',23, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (38, '1985-01-08', 'fantastic shot !!!!!!',23, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (39, '1985-01-08', '++Beautiful',23, 2);
+UPDATE Album set coveringImage_id=23 where id = 5;
 
 ---------------------------------------------------------------------
 -- ALBUM - Water"
 ---------------------------------------------------------------------
-INSERT INTO albums(album_id, name, description, shelf_id, created) VALUES (6, 'Water', 'Water pictures',  1, '2009-12-18');
-INSERT INTO metatags(metatag_id, tag) VALUES (6,  'Water');
+INSERT INTO Album(id, name, description, shelf_id, created) VALUES (6, 'Water', 'Water pictures',  1, '2009-12-18');
+INSERT INTO MetaTag(id, tag) VALUES (6,  'Water');
 
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (24, '117215467_5cccef9aaa_b.jpg', '117215467_5cccef9aaa_b.jpg', 'Water - 117215467_5cccef9aaa_b.jpg image',  '2009-12-18', 6, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 24);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (42, '1985-01-08', 'Very *lovely*',24, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (43, '1985-01-08', 'whoah ! wonderful',24, 3);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (25, '1323769314_fe850cd954_o.jpg', '1323769314_fe850cd954_o.jpg', 'Water - 1323769314_fe850cd954_o.jpg image',  '2009-12-18', 6, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 25);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (26, '205579493_baf0f850d1_o.jpg', '205579493_baf0f850d1_o.jpg', 'Water - 205579493_baf0f850d1_o.jpg image',  '2009-12-18', 6, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 26);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (44, '1985-01-08', 'Wow!! Macro stupenda!!! Complimenti! ',26, 2);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (45, '1985-01-08', '++Beautiful',26, 3);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (46, '1985-01-08', 'Amazing shot..',26, 1);
-  INSERT INTO comments(comment_id, date, message, image_id, user_id) VALUES (47, '1985-01-08', 'Superb Shot and so beautiful Colors !!! ',26, 1);
-INSERT INTO images(image_id, name, path, description, created, album_id,  cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (27, '2198502835_1644c8fde2_o.jpg', '2198502835_1644c8fde2_o.jpg', 'Water - 2198502835_1644c8fde2_o.jpg image',  '2009-12-18', 6, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
-  INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(6, 27);
-UPDATE albums set coveringimage_image_id=27 where album_id = 6;
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (24, '117215467_5cccef9aaa_b.jpg', '117215467_5cccef9aaa_b.jpg', 'Water - 117215467_5cccef9aaa_b.jpg image',  '2009-12-18', 6, 'Panasonic', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 24);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (40, '1985-01-08', 'this is extremely Good:) Congratulations!',24, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (41, '1985-01-08', 'really pretty. it looks like there is a lady in the _center_, blowing kisses!!',24, 3);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (25, '1323769314_fe850cd954_o.jpg', '1323769314_fe850cd954_o.jpg', 'Water - 1323769314_fe850cd954_o.jpg image',  '2009-12-18', 6, 'LG LDC-A310', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 25);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (42, '1985-01-08', 'Such a lovely colour azaga!',25, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (43, '1985-01-08', 'that is a beautiful flower with great colours ',25, 3);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (44, '1985-01-08', '++Beautiful',25, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (26, '205579493_baf0f850d1_o.jpg', '205579493_baf0f850d1_o.jpg', 'Water - 205579493_baf0f850d1_o.jpg image',  '2009-12-18', 6, 'Canon EOS 450D', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 26);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (45, '1985-01-08', 'fantastic shot !!!!!!',26, 2);
+INSERT INTO Image(id, name, path, description, created, album_id, cameraModel, width, size, height, uploaded, allowComments, showMetaInfo) VALUES (27, '2198502835_1644c8fde2_o.jpg', '2198502835_1644c8fde2_o.jpg', 'Water - 2198502835_1644c8fde2_o.jpg image',  '2009-12-18', 6, 'Sony CyberShot DSC-T77', 1024, 1917, 768, '2009-12-01', true, true);
+  INSERT INTO Image_MetaTag(IMAGETAGS_ID, IMAGES_ID) VALUES(6, 27);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (46, '1985-01-08', 'Amazing shot..',27, 2);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (47, '1985-01-08', 'fantastic shot !!!!!!',27, 1);
+  INSERT INTO Comment(id, date, message, image_id, author_id) VALUES (48, '1985-01-08', '++Beautiful',27, 2);
+UPDATE Album set coveringImage_id=27 where id = 6;
 
 

Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java	2009-04-25 14:32:30 UTC (rev 13863)
@@ -20,11 +20,17 @@
  */
 package org.richfaces.photoalbum.domain;
 
-import java.io.File;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import org.hibernate.annotations.Fetch;
+import org.hibernate.annotations.FetchMode;
+import org.hibernate.annotations.OnDelete;
+import org.hibernate.annotations.OnDeleteAction;
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotEmpty;
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
 
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
@@ -36,21 +42,14 @@
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
-import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
+import java.io.File;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 
-import org.hibernate.validator.Length;
-import org.hibernate.validator.NotEmpty;
-import org.hibernate.validator.NotNull;
-import org.hibernate.annotations.Fetch;
-import org.hibernate.annotations.FetchMode;
-import org.hibernate.annotations.ForeignKey;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-
 /**
  * Class for representing Album Entity. EJB3 Entity Bean
  *
@@ -58,283 +57,254 @@
  */
 @Entity
 @Name("album")
- at Table(name = "albums")
 @Scope(ScopeType.CONVERSATION)
 @AutoCreate
 public class Album implements Serializable {
 
-    private static final long serialVersionUID = -7042878411608396483L;
+	private static final long serialVersionUID = -7042878411608396483L;
 
-    @Id
-    @GeneratedValue
-    @Column(name = "ALBUM_ID")
-    private Long id = null;
+	@Id
+	@GeneratedValue
+	private Long id = null;
 
-    @Column(length = 255, nullable = false)
+	@OneToMany(cascade = CascadeType.ALL, mappedBy = "album")
+	@Fetch(FetchMode.SELECT)
+	private List<Image> images = new ArrayList<Image>();
+
     @NotNull
-    @NotEmpty
-    @Length(min = 3, max = 50)
-    private String name;
+    @ManyToOne
+    @JoinColumn(nullable = false)
+	@OnDelete(action = OnDeleteAction.CASCADE)
+	private Shelf shelf;
 
-    @Column(length = 1024)
-    private String description;
+	@OneToOne(fetch = FetchType.LAZY)
+	private Image coveringImage;
 
-    @OneToMany(cascade = CascadeType.ALL, mappedBy = "album")
-    @Fetch(FetchMode.SUBSELECT)
-    private List<Image> images = new ArrayList<Image>();
+	@Temporal(TemporalType.TIMESTAMP)
+	private Date created;
 
-    @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
-    @JoinColumn(name = "SHELF_ID", nullable = false)
-    @ForeignKey(name = "FK_SHELF_ID")
-    private Shelf shelf;
+	@Column(length = 255, nullable = false)
+	@NotNull
+	@NotEmpty
+	@Length(min = 3, max = 50)
+	private String name;
 
-    @Temporal(TemporalType.TIMESTAMP)
-    private Date created;
+	@Column(length = 1024)
+	private String description;
 
-    @OneToOne(optional = true)
-    private Image coveringImage;
+	// ********************** Accessor Methods ********************** //
 
-    // ********************** Accessor Methods ********************** //
+	/**
+	 * Getter for property shelf
+	 *
+	 * @return Shelf object, that contains this album
+	 */
+	public Shelf getShelf() {
+		return shelf;
+	}
 
-    /**
-     * Getter for property shelf
-     *
-     * @return Shelf object, that contains this album
-     */
-    public Shelf getShelf() {
-        return shelf;
-    }
+	public void setShelf(Shelf parent) {
+		this.shelf = parent;
+	}
 
-    /**
-     * Setter for property shelf
-     *
-     * @param parent -
-     *             Shelf object
-     */
-    public void setShelf(Shelf parent) {
-        this.shelf = parent;
-    }
+	public Long getId() {
+		return id;
+	}
 
-    /**
-     * Getter for property id
-     *
-     * @return id of album
-     */
-    public Long getId() {
-        return id;
-    }
+	public String getName() {
+		return name;
+	}
 
-    /**
-     * Getter for property name
-     *
-     * @return name of album
-     */
-    public String getName() {
-        return name;
-    }
+	public void setName(String name) {
+		this.name = name;
+	}
 
-    /**
-     * Setter for property name
-     *
-     * @param name -
-     *             new name of album
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
+	public String getDescription() {
+		return description;
+	}
 
-    /**
-     * Getter for property description
-     *
-     * @return description of album
-     */
-    public String getDescription() {
-        return description;
-    }
+	public void setDescription(String description) {
+		this.description = description;
+	}
 
-    /**
-     * Setter for property description
-     *
-     * @param description -
-     *                    new description of album
-     */
-    public void setDescription(String description) {
-        this.description = description;
-    }
+	/**
+	 * Getter for property images
+	 *
+	 * @return List if images, belongs to this album
+	 */
+	public List<Image> getImages() {
+		return images;
+	}
 
-    /**
-     * Getter for property images
-     *
-     * @return List if images, belongs to this album
-     */
-    public List<Image> getImages() {
-        return images;
-    }
-    
-    /**
-     * @return the date of creation
-     */
-    public Date getCreated() {
-        return created;
-    }
+	public Date getCreated() {
+		return created;
+	}
 
-    /**
-     * @param created - Date of creation of this album
-     */
-    public void setCreated(Date created) {
-        this.created = created;
-    }
-    
-    /**
-     * @return List of unvisited images
-     */
-    public List<Image> getUnvisitedImages() {
-    	List<Image> unvisitedImages = new ArrayList<Image>();
-    	for(Image i : this.getImages()){
-    		if(i.isNew()){
-    			unvisitedImages.add(i);
-    		}
-    	}
-        return unvisitedImages;
-    }
-    
-    /**
-     * @param coveringImage - Image for covering album
-     */
-    public void setCoveringImage(Image coveringImage) {
-        this.coveringImage = coveringImage;
-    }
-    
-    // ********************** Business Methods ********************** //
+	public void setCreated(Date created) {
+		this.created = created;
+	}
 
-    /**
-     * This method add image to collection of images of current album
-     *
-     * @param image -
-     *              image to add
-     */
-    public void addImage(Image image) {
-        if (image == null) {
-            throw new IllegalArgumentException("Null image!");
-        }if(this.getImages().contains(image)){
-        	//If album contain this image already
-        	return;
-        }
-        if (image.getAlbum() != null && !this.equals(image.getAlbum())) {
-        	//Remove from previous album
-        	image.getAlbum().removeImage(image);
-        }
-        image.setAlbum(this);
-        images.add(image);
-    }
+	/**
+	 * @return List of unvisited images
+	 */
+	public List<Image> getUnvisitedImages() {
+		final List<Image> unvisitedImages = new ArrayList<Image>(this.getImages().size());
+		for (Image i : this.getImages()) {
+			if (i.isNew()) {
+				unvisitedImages.add(i);
+			}
+		}
+		return unvisitedImages;
+	}
 
-    /**
-     * This method remove image from collection of images of album
-     *
-     * @param image -
-     *              image to remove
-     */
-    public void removeImage(Image image) {
-        if (image == null) {
-            throw new IllegalArgumentException("Null image");
-        }
-        if(image.getAlbum().equals(this)){
-        	image.setAlbum(null);
-            images.remove(image);
-        }else{
-        	throw new IllegalArgumentException("This album not contain this image!");
-        }
-    }
+	/**
+	 * @param coveringImage - Image for covering album
+	 */
+	public void setCoveringImage(Image coveringImage) {
+		this.coveringImage = coveringImage;
+	}
 
-    /**
-     * Getter for property owner
-     *
-     * @return User object, owner of this album
-     */
-    public User getOwner() {
-        return getShelf()!=null ? getShelf().getOwner(): null;
-    }
+	// ********************** Business Methods ********************** //
 
-    /**
-     * This method determine index of specified image in collection of images, belongs to this album.
-     * Used in slideshow etc...
-     *
-     * @return index of specified image
-     */
-    public int getIndex(Image image) {
-		if(this.images.size() > 0){
-			return this.images.indexOf(image);
+	/**
+	 * This method add image to collection of images of current album
+	 *
+	 * @param image -
+	 *              image to add
+	 */
+	public void addImage(Image image) { // TODO
+		if (image == null) {
+			throw new IllegalArgumentException("Null image!");
 		}
-		return -1;
-    }
+		if (this.getImages().contains(image)) {
+			//If album contain this image already
+			return;
+		}
+		if (image.getAlbum() != null && !this.equals(image.getAlbum())) {
+			//Remove from previous album
+			image.getAlbum().removeImage(image);
+		}
+		image.setAlbum(this);
+		images.add(image);
+	}
 
-    /**
-     * This method determine covering image of this album
-     *
-     * @return covering image
-     */
-    public Image getCoveringImage() {
-        if (coveringImage != null) {
-            return coveringImage;
-        }
-        if (!isEmpty()) {
-        	//If no image defined as covering
-            coveringImage = images.get(0);
-            return images.get(0);
-        } else {
-        	//Album haven't images
-            return null;
-        }
-    }
+	/**
+	 * This method remove image from collection of images of album
+	 *
+	 * @param image -
+	 *              image to remove
+	 */
+	public void removeImage(Image image) {
+		if (image == null) {
+			throw new IllegalArgumentException("Null image");
+		}
+		if (!image.getAlbum().equals(this)) {
+			throw new IllegalArgumentException("This album not contain this image!");
+		}
 
-    /**
-     * This method determine is album empty or not
-     *
-     */
-    public boolean isEmpty() {
-        return images == null || images.size() == 0;
-    }
+		if (getCoveringImage().equals(image)) {
+			setCoveringImage(null);
+		}
 
-    /**
-     * Getter for property preDefined
+		images.remove(image);
+	}
+
+	/**
+	 * Getter for property owner
+	 *
+	 * @return User object, owner of this album
+	 */
+	public User getOwner() {
+		return getShelf().getOwner();
+	}
+
+	public boolean isOwner(User user) {
+		return user != null && user.equals(getOwner());
+	}
+
+	/**
+	 * This method determine index of specified image in collection of images, belongs to this album.
+	 * Used in slideshow etc...
+	 *
+	 * @return index of specified image
+	 */
+	public int getIndex(Image image) {
+		if (isEmpty()) {
+			return -1;
+		}
+
+		return images.indexOf(image);
+	}
+
+	/**
+	 * This method determine covering image of this album
+	 *
+	 * @return covering image
+	 */
+	public Image getCoveringImage() {
+		if (coveringImage == null && !isEmpty()) {
+			coveringImage = images.get(0);
+		}
+
+		return coveringImage;
+	}
+
+	/**
+	 * This method determine is album empty or not
      *
-     * @return is this shelf is predefined
-     */
-    public boolean isPreDefined() {
-		return getOwner() != null ? getOwner().isPreDefined() : false;
+	 */
+	public boolean isEmpty() {
+		return images == null || images.isEmpty();
 	}
-    
-    /**
-     * Return relative path of this album in file-system(relative to uploadRoot parameter)
+
+	/**
+	 * Getter for property preDefined
+	 *
+	 * @return is this shelf is predefined
+	 */
+	public boolean isPreDefined() {
+		return getOwner().isPreDefined();
+	}
+
+	/**
+	 * Return relative path of this album in file-system(relative to uploadRoot parameter)
      *
-     */
-    public String getPath(){
-		if(getShelf() != null && getOwner() != null && getShelf().getPath() != null){
-			return getShelf().getPath() + this.getId().toString() + File.separator;
+	 */
+	public String getPath() {
+		if (getShelf().getPath() == null) {
+			return null;
 		}
-		return null;
+		return getShelf().getPath() + this.getId() + File.separator;
 	}
-    
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
 
-        Album album = (Album) o;
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj) {
+			return true;
+		}
+		if (obj == null || getClass() != obj.getClass()) {
+			return false;
+		}
 
-        if (id != null ? !id.equals(album.id) : album.id != null) return false;
-        if (!shelf.equals(album.shelf)) return false;
-        if (!name.equals(album.name)) return false;
+		final Album album = (Album) obj;
 
-        return true;
-    }
+		if (id != null ? !id.equals(album.id) : album.id != null) return false;
+		if (!shelf.equals(album.shelf)) return false;
+		if (!name.equals(album.name)) return false;
 
-    @Override
-    public int hashCode() {
-        int result;
-        result = id != null ? id.hashCode() : 0;
-        result = 31 * result + name.hashCode();
-        result = 31 * result + shelf.hashCode();
-        return result;
-    }
-}
+		return true;
+	}
+
+	@Override
+	public int hashCode() {
+		int result = id != null ? id.hashCode() : 0;
+		result = 31 * result + name.hashCode();
+		result = 31 * result + shelf.hashCode();
+		return result;
+	}
+
+	@Override
+	public String toString() {
+		return "{id : "+getId()+", name : "+getName()+"}";
+	}
+}
\ No newline at end of file

Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Comment.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Comment.java	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Comment.java	2009-04-25 14:32:30 UTC (rev 13863)
@@ -20,9 +20,17 @@
  */
 package org.richfaces.photoalbum.domain;
 
-import java.io.Serializable;
-import java.util.Date;
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotEmpty;
+import org.hibernate.validator.NotNull;
+import org.hibernate.annotations.OnDelete;
+import org.hibernate.annotations.OnDeleteAction;
+import org.hibernate.annotations.ForeignKey;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
 
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
@@ -30,16 +38,10 @@
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
-import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
-
-import org.hibernate.validator.Length;
-import org.hibernate.validator.NotEmpty;
-import org.hibernate.validator.NotNull;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
+import java.io.Serializable;
+import java.util.Date;
 /**
  * Class for representing Comment Entity. EJB3 Entity Bean
  *
@@ -48,7 +50,6 @@
 
 @Entity
 @Name("comment")
- at Table(name = "comments")
 @Scope(ScopeType.EVENT)
 public class Comment implements Serializable {
 
@@ -56,26 +57,26 @@
 
     @Id
     @GeneratedValue
-    @Column(name = "COMMENT_ID")
     private Long id;
 
-    @Temporal(TemporalType.TIMESTAMP)
-    private Date date;
+    @ManyToOne
+	@OnDelete(action = OnDeleteAction.CASCADE)
+	@JoinColumn(nullable = false)
+	private Image image;
 
-    @ManyToOne(optional=false)
-    @JoinColumn(name = "IMAGE_ID", referencedColumnName = "IMAGE_ID")
-    private Image image;
-
     @ManyToOne(fetch = FetchType.LAZY)
-    @JoinColumn(name = "USER_ID", nullable = false, updatable = false)
-    @org.hibernate.annotations.ForeignKey(name = "FK_USER_ID")
-    private User author;
+	@OnDelete(action = OnDeleteAction.CASCADE)
+	@JoinColumn(nullable = true)
+	private User author;
 
-    @Column(length = 1024, nullable = false)
+	@Temporal(TemporalType.TIMESTAMP)
+	private Date date;
+
     @NotNull
     @NotEmpty
     @Length(min = 2)
-    private String message;
+	@Column(length = 1024, nullable = false)
+	private String message;
 
     /**
      * Getter for property preDefined
@@ -83,7 +84,7 @@
      * @return is this shelf is predefined
      */
     public boolean isPreDefined() {
-		return getImage() != null? getImage().isPreDefined() : false;
+		return getImage().isPreDefined();
 	}
     //---------------------------------------Getters, Setters
     public Long getId() {
@@ -122,23 +123,27 @@
         this.image = image;
     }
 
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+    @Override
+	public boolean equals(Object obj) {
+        if (this == obj) {
+			return true;
+		}
+		
+		if (obj == null || getClass() != obj.getClass()) {
+			return false;
+		}
 
-        Comment comment = (Comment) o;
+        final Comment comment = (Comment) obj;
 
-        if (!author.equals(comment.author)) return false;
-        if (id != null ? !id.equals(comment.id) : comment.id != null) return false;
-        if (!image.equals(comment.image)) return false;
-        if (!message.equals(comment.message)) return false;
-
-        return true;
+        return (id == null ? comment.getId() == null : id.equals(comment.getId()))
+				&& (author == null ? comment.getAuthor() == null : author.equals(comment.getAuthor()))
+				&& image.equals(comment.getImage())
+				&& message.equals(comment.getMessage());
     }
 
-    public int hashCode() {
-        int result;
-        result = (id != null ? id.hashCode() : 0);
+    @Override
+	public int hashCode() {
+        int result = id != null ? id.hashCode() : 0;
         result = 31 * result + image.hashCode();
         result = 31 * result + author.hashCode();
         result = 31 * result + message.hashCode();

Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java	2009-04-25 14:32:30 UTC (rev 13863)
@@ -25,11 +25,14 @@
  */
 package org.richfaces.photoalbum.domain;
 
-import org.hibernate.annotations.Fetch;
-import org.hibernate.annotations.FetchMode;
+import org.hibernate.annotations.Cascade;
 import org.hibernate.annotations.LazyCollection;
 import org.hibernate.annotations.LazyCollectionOption;
 import org.hibernate.annotations.OrderBy;
+import org.hibernate.annotations.Table;
+import org.hibernate.annotations.ForeignKey;
+import org.hibernate.annotations.OnDelete;
+import org.hibernate.annotations.OnDeleteAction;
 import org.hibernate.validator.Length;
 import org.hibernate.validator.NotEmpty;
 import org.hibernate.validator.NotNull;
@@ -45,14 +48,11 @@
 import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
 import javax.persistence.ManyToMany;
 import javax.persistence.ManyToOne;
 import javax.persistence.NamedQueries;
 import javax.persistence.NamedQuery;
 import javax.persistence.OneToMany;
-import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
@@ -64,7 +64,7 @@
 @NamedQueries({
 	@NamedQuery(
 			name = "tag-byName",
-			query = "from MetaTag m where m.tag =:tag"
+			query = "select m from MetaTag m where m.tag =:tag"
 	),
 	@NamedQuery(
 			name = "tag-popular",
@@ -76,7 +76,7 @@
 	),
 	@NamedQuery(
 			name = "image-exist",
-			query = "from Image i where i.path = :path and i.album = :album"
+			query = "select i from Image i where i.path = :path and i.album = :album"
 	),
 	@NamedQuery(
 			name = "tag-suggest",
@@ -91,56 +91,45 @@
 
 @Entity
 @Name("image")
- at Table(name = "Images")
 @Scope(ScopeType.CONVERSATION)
 @AutoCreate
 public class Image implements Serializable {
 
 	private static final long serialVersionUID = -7042878411608396483L;
 
-	public static final int STRING_LENGTH = 255;
-	public static final int TEXT_LENGTH = 1024;
-
 	@Id
 	@GeneratedValue
-	@Column(name = "IMAGE_ID")
-	private Long id = null;
+	private Long id;
 
+	@ManyToMany
+	private List<MetaTag> imageTags = new ArrayList<MetaTag>();
 
-	@Column(length = STRING_LENGTH, nullable = false)
+	@OrderBy(clause = "date asc")
+	@OneToMany(cascade = CascadeType.REMOVE, mappedBy = "image")
+	// @Fetch(FetchMode.SUBSELECT)
+	private List<Comment> comments = new ArrayList<Comment>();
+
 	@NotNull
+	@ManyToOne
+	@OnDelete(action = OnDeleteAction.CASCADE)
+	private Album album;
+
+	@NotNull
 	@NotEmpty
 	@Length(min = 3)
+	@Column(length = 255, nullable = false)
 	private String name;
 
 	@Transient
 	private boolean covering;
 
-	@Column(length = TEXT_LENGTH, nullable = false)
 	@NotNull
 	@NotEmpty
 	@Length(min = 3)
+	@Column(length = 1024, nullable = false)
 	private String path;
 
-	@ManyToMany(cascade = CascadeType.PERSIST)
-	@JoinTable(name = "IMAGES_METATAGS",
-			joinColumns =
-			@JoinColumn(name = "CI_IMAGE_ID",
-					referencedColumnName = "IMAGE_ID"),
-			inverseJoinColumns =
-			@JoinColumn(name = "CI_METATAG_ID",
-					referencedColumnName = "METATAG_ID"))
-	private List<MetaTag> imageTags = new ArrayList<MetaTag>();
-
-	@Transient
-	private boolean visited;
-	/*
-		 * Comma separated tag value
-		 * */
-	@Transient
-	private String meta = "";
-
-	@Column(length = STRING_LENGTH)
+	@Column(length = 255)
 	private String cameraModel;
 
 	private int height;
@@ -152,38 +141,36 @@
 	@Temporal(TemporalType.TIMESTAMP)
 	private Date uploaded;
 
-	@Column(length = TEXT_LENGTH)
 	@NotNull
 	@NotEmpty
 	@Length(min = 3)
+	@Column(length = 1024)
 	private String description;
 
 	@Temporal(TemporalType.TIMESTAMP)
 	private Date created;
 
-	@OneToMany(mappedBy = "image", cascade = {
-			CascadeType.ALL}, fetch = FetchType.LAZY)
-	@LazyCollection(LazyCollectionOption.EXTRA)
-	@OrderBy(clause = "date asc")
-	@Fetch(FetchMode.SUBSELECT)
-	private List<Comment> comments = new ArrayList<Comment>();
-
-	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "ALBUM_ID", referencedColumnName = "ALBUM_ID")
-	private Album album;
-
 	@NotNull
 	private boolean allowComments;
 
 	private Boolean showMetaInfo = true;
 
+	@Transient
+	private boolean visited;
+
+	/*
+	 * Comma separated tags value
+	 * */
+	@Transient
+	private String meta = "";
+
 	/**
 	 * Getter for property preDefined
 	 *
 	 * @return is this shelf is predefined
 	 */
 	public boolean isPreDefined() {
-		return getAlbum() != null && getAlbum().isPreDefined();
+		return getAlbum().isPreDefined();
 	}
 
 	// ********************** Accessor Methods ********************** //
@@ -245,38 +232,18 @@
 		this.created = created;
 	}
 
-	/**
-	 * Getter for property album
-	 *
-	 * @return containing album
-	 */
 	public Album getAlbum() {
 		return album;
 	}
 
-	/**
-	 * Setter for property album
-	 *
-	 * @param album - album, that will contain this image
-	 */
 	public void setAlbum(Album album) {
 		this.album = album;
 	}
 
-	/**
-	 * Getter for property comments
-	 *
-	 * @return collection of comments, belongs to that image
-	 */
 	public List<Comment> getComments() {
 		return comments;
 	}
 
-	/**
-	 * Getter for property imageTags
-	 *
-	 * @return collection of MetaTags, associated to that image
-	 */
 	public List<MetaTag> getImageTags() {
 		return imageTags;
 	}
@@ -382,6 +349,10 @@
 		return covering;
 	}
 
+	public void setImageTags(final List<MetaTag> imageTags) {
+		this.imageTags = imageTags;
+	}
+
 	/**
 	 * @param covering - determine if this image is covering for containing album
 	 */
@@ -514,14 +485,22 @@
 	 * Return relative path of this image in file-system(relative to uploadRoot parameter)
 	 */
 	public String getFullPath() {
-		if (getAlbum() != null
-				&& getAlbum().getOwner() != null
-				&& getAlbum().getPath() != null) {
-			return getAlbum().getPath() + this.path;
+		if (getAlbum().getPath() == null) {
+			return null;
 		}
-		return null;
+
+		return getAlbum().getPath() + this.path;
 	}
 
+
+	public User getOwner() {
+		return getAlbum().getOwner();
+	}
+
+	public boolean isOwner(User user) {
+		return user != null && user.equals(getOwner());
+	}
+
 	@Override
 	public boolean equals(Object obj) {
 		if (this == obj) {
@@ -544,4 +523,9 @@
 		result = 31 * result + (path != null ? path.hashCode() : 0);
 		return result;
 	}
+
+	@Override
+	public String toString() {
+		return "{id : "+getId()+", name : "+getName()+"}";
+	}
 }

Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/MetaTag.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/MetaTag.java	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/MetaTag.java	2009-04-25 14:32:30 UTC (rev 13863)
@@ -41,86 +41,96 @@
 
 /**
  * Class for representing MetaTag Entity
- *  EJB3 Entity Bean
+ * EJB3 Entity Bean
  *
  * @author Andrey Markhel
  */
 
 @Entity
 @Name("metaTag")
- at Table(name = "metatags", uniqueConstraints = {
-		@UniqueConstraint(columnNames = "tag")
+ at Table(uniqueConstraints = {
+	@UniqueConstraint(columnNames = "tag")
 		})
 @Scope(ScopeType.EVENT)
 public class MetaTag implements Serializable {
 
-    private static final long serialVersionUID = -9065024051468971330L;
+	private static final long serialVersionUID = -9065024051468971330L;
 
-    @Id
-    @GeneratedValue
-    @Column(name = "METATAG_ID")
-    private Long id;
+	@Id
+	@GeneratedValue
+	private Long id;
 
-    @Column(length = 255, nullable = false)
-    @NotNull
-    @NotEmpty
-    @Length(min = 3, max=50)
-    private String tag;
+	@Column(length = 255, nullable = false)
+	@NotNull
+	@NotEmpty
+	@Length(min = 3, max = 50)
+	private String tag;
 
-    @ManyToMany(mappedBy = "imageTags")
-    private List<Image> images = new ArrayList<Image>();
+	@ManyToMany(mappedBy = "imageTags")
+	private List<Image> images = new ArrayList<Image>();
 
-    public MetaTag() {
-    }
-    
-    public MetaTag(Long id, String tag) {
-        this.id = id;
-        this.tag = tag;
-    }
+	public MetaTag() {
+	}
 
-    //---------------------------------Getters, Setters..
-    public Long getId() {
-        return id;
-    }
+	public MetaTag(Long id, String tag) {
+		this.id = id;
+		this.tag = tag;
+	}
 
-    public String getTag() {
-        return tag;
-    }
+	//---------------------------------Getters, Setters..
+	public Long getId() {
+		return id;
+	}
 
-    public void setTag(String tag) {
-        this.tag = tag;
-    }
+	public String getTag() {
+		return tag;
+	}
 
-    public List<Image> getImages() {
-        return images;
-    }
+	public void setTag(String tag) {
+		this.tag = tag;
+	}
 
-    public void setImages(List<Image> images) {
-        this.images = images;
-    }
+	public List<Image> getImages() {
+		return images;
+	}
 
-    public void addImage(Image image) {
-        images.add(image);
-    }
+	public void setImages(List<Image> images) {
+		this.images = images;
+	}
 
-    public void removeImage(Image image) {
-        images.remove(image);
-    }
+	public void addImage(Image image) {
+		images.add(image);
+	}
 
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+	public void removeImage(Image image) {
+		images.remove(image);
+	}
 
-        MetaTag metaTag = (MetaTag) o;                 
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj) {
+			return true;
+		}
+		
+		if (obj == null || getClass() != obj.getClass()) {
+			return false;
+		}
 
-        return (id == null ? metaTag.id == null : id.equals(metaTag.id))
-                && tag.equalsIgnoreCase(metaTag.tag);
-    }
+		final MetaTag metaTag = (MetaTag) obj;
 
-    public int hashCode() {
-        int result;
-        result = (id != null ? id.hashCode() : 0);
-        result = 31 * result + tag.hashCode();
-        return result;
-    }
+		return (id == null ? metaTag.getId() == null : id.equals(metaTag.getId()))
+				&& tag.equalsIgnoreCase(metaTag.getTag());
+	}
+
+	@Override
+	public int hashCode() {
+		int result = id != null ? id.hashCode() : 0;
+		result = 31 * result + tag.hashCode();
+		return result;
+	}
+
+	@Override
+	public String toString() {
+		return "{id : "+getId()+", tag : "+getTag()+"}"; 
+	}
 }

Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Sex.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Sex.java	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Sex.java	2009-04-25 14:32:30 UTC (rev 13863)
@@ -29,9 +29,9 @@
     MALE("1"),
     FEMALE("0");
 
-    String key;
+    private String key;
 
-    private Sex(String key) {
+    Sex(String key) {
         this.key = key;
     }
 
@@ -41,11 +41,4 @@
     public String getKey() {
         return key;
     }
-
-    /**
-     * @param key the key to set
-     */
-    public void setKey(String key) {
-        this.key = key;
-    }
 }

Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Shelf.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Shelf.java	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Shelf.java	2009-04-25 14:32:30 UTC (rev 13863)
@@ -1,10 +1,13 @@
 package org.richfaces.photoalbum.domain;
 
-import java.io.File;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import org.hibernate.annotations.OrderBy;
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotEmpty;
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
 
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
@@ -12,281 +15,240 @@
 import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
-import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
-import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
+import java.io.File;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 
-import org.hibernate.validator.Length;
-import org.hibernate.validator.NotEmpty;
-import org.hibernate.validator.NotNull;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-
 @Entity
 @Name("shelf")
 @Scope(ScopeType.CONVERSATION)
- at Table(name = "shelves")
 @AutoCreate
 public class Shelf implements Serializable {
 
-    private static final long serialVersionUID = -7042878411608396483L;
+	private static final long serialVersionUID = -7042878411608396483L;
 
-    @Id
-    @GeneratedValue
-    @Column(name = "SHELF_ID")
-    private Long id = null;
+	@Id
+	@GeneratedValue
+	private Long id;
 
-    @Column(length = 255, nullable = false)
-    @NotNull
-    @NotEmpty
-    @Length(min = 3, max = 50)
-    private String name;
+	@Column(nullable = false)
+	@NotNull
+	@NotEmpty
+	@Length(min = 3, max = 50)
+	private String name;
 
-    @Column(length = 1024)
-    private String description;
+	@Column(length = 1024)
+	private String description;
 
-    @ManyToOne(fetch = FetchType.LAZY)
-    @JoinColumn(name = "USER_ID", referencedColumnName = "USER_ID")
+    @ManyToOne
     private User owner;
 
-    @OneToMany(mappedBy = "shelf", cascade = {CascadeType.ALL})
-    @org.hibernate.annotations.OrderBy(clause = "NAME asc")
-    private List<Album> albums = new ArrayList<Album>();
+	@OneToMany(mappedBy = "shelf", cascade = CascadeType.REMOVE)
+	@OrderBy(clause = "NAME asc")
+	private List<Album> albums = new ArrayList<Album>();
 
-    @NotNull
-    private boolean shared;
+	@NotNull
+	private boolean shared;
 
-    @Temporal(TemporalType.TIMESTAMP)
-    private Date created;
+	@Temporal(TemporalType.TIMESTAMP)
+	private Date created;
 
-    /**
-     * Getter for property preDefined
-     *
-     * @return is this shelf is predefined
-     */
-    public boolean isPreDefined() {
-		return getOwner() != null? getOwner().isPreDefined() : false;
+	/**
+	 * Getter for property preDefined
+	 *
+	 * @return is this shelf is predefined
+	 */
+	public boolean isPreDefined() {
+		return getOwner() != null && getOwner().isPreDefined();
 	}
 
+	public Long getId() {
+		return id;
+	}
+
 	/**
-     * Getter for property id
-     *
-     * @return id of album
-     */
-    public Long getId() {
-        return id;
-    }
+	 * Getter for property name
+	 *
+	 * @return name of album
+	 */
+	public String getName() {
+		return name;
+	}
 
-    /**
-     * Getter for property name
-     *
-     * @return name of album
-     */
-    public String getName() {
-        return name;
-    }
+	public void setName(String name) {
+		this.name = name;
+	}
 
-    /**
-     * Setter for property name
-     *
-     * @param name -
-     *             name of album
-     */
-    public void setName(String name) {
-        this.name = name;
-    }
+	public String getDescription() {
+		return description;
+	}
 
-    /**
-     * Getter for property description
-     *
-     * @return description of album
-     */
-    public String getDescription() {
-        return description;
-    }
+	public void setDescription(String description) {
+		this.description = description;
+	}
 
-    /**
-     * Setter for property description
-     *
-     * @param description -
-     *                    description of album
-     */
-    public void setDescription(String description) {
-        this.description = description;
-    }
+	public List<Album> getAlbums() {
+		return albums;
+	}
 
-    /**
-     * Getter for property albums
-     *
-     * @return collection of albums, belongs to this shelf.
-     */
-    public List<Album> getAlbums() {
-        return albums;
-    }
+	public User getOwner() {
+		return owner;
+	}
 
-    /**
-     * Getter for property owner
-     *
-     * @return user, that created this shelf
-     */
-    public User getOwner() {
-        return owner;
-    }
+	public void setOwner(User owner) {
+		this.owner = owner;
+	}
 
-    /**
-     * Setter for property owner
-     *
-     * @param owner -owner of shelf
-     */
-    public void setOwner(User owner) {
-        this.owner = owner;
-    }
+	public boolean isOwner(User user) {
+		return getOwner().equals(user);
+	}
 
-    /**
-     * Getter for property created
-     *
-     * @return date of creation of this shelf
-     */
-    public Date getCreated() {
-        return created;
-    }
+	public Date getCreated() {
+		return created;
+	}
 
-    /**
-     * Setter for property created
-     *
-     * @param created - date of creation
-     */
-    public void setCreated(Date created) {
-        this.created = created;
-    }
+	public void setCreated(Date created) {
+		this.created = created;
+	}
 
-    /**
-     * Getter for property shared. If true - all users can view this shelves and albums and images, contained in this shelf,
-     * otherwise this shelf can view only owner.
-     *
-     * @return shared
-     */
-    public boolean isShared() {
-        return shared;
-    }
+	/**
+	 * Getter for property shared. If true - all users can view this shelves and albums and images, contained in this shelf,
+	 * otherwise this shelf can view only owner.
+	 *
+	 * @return shared
+	 */
+	public boolean isShared() {
+		return shared;
+	}
 
-    /**
-     * Setter for property shared
-     *
-     * @param shared - determine is this shelf will be accessible by other users.
-     */
-    public void setShared(boolean shared) {
-        this.shared = shared;
-    }
-    
- // ********************** Business Methods ********************** //
-    
-    /**
-     * @return List of unvisited images
-     */
-    public List<Image> getUnvisitedImages() {
-    	List<Image> unvisitedImages = new ArrayList<Image>();
-    	for(Album a : getAlbums()){
-    		for(Image i : a.getImages()){
-    			if(i.isNew()){
-    				unvisitedImages.add(i);
-    			}
-    		}
-    	}
-        return unvisitedImages;
-    }
-    
-    /**
-     * @return List of images, belongs to this shelf
-     */
-    public List<Image> getImages() {
-    	List<Image> images = new ArrayList<Image>();
-    	for(Album a : getAlbums()){
-    		images.addAll(a.getImages());
-    	}
-        return images;
-    }
-    
-    /**
-     * This method add album to collection of albums of current shelf
-     *
-     * @param album -
-     *              album to add
-     */
-    public void addAlbum(Album album) {
-        if (album == null)
-            throw new IllegalArgumentException("Null album!");
-        if (album.getShelf() != null && !album.getShelf().getAlbums().contains(this)){
-            // remove from previous shelf
-        	album.getShelf().removeAlbum(album);
-            album.setShelf(this);
-            albums.add(album);
-        }	
-    }
+	/**
+	 * Setter for property shared
+	 *
+	 * @param shared - determine is this shelf will be accessible by other users.
+	 */
+	public void setShared(boolean shared) {
+		this.shared = shared;
+	}
 
-    /**
-     * This method remove album from collection of albums of album
-     *
-     * @param album -
-     *              album to remove
-     */
-    public void removeAlbum(Album album) {
-        if (album == null)
-            throw new IllegalArgumentException("Null album!");
-        if(album.getShelf().equals(this)){
-        	album.setShelf(null);
-            albums.remove(album);
-        }else{
-        	throw new IllegalArgumentException("This Shelf not contain this album!");
-        }
-    }
+	// ********************** Business Methods ********************** //
 
-    /**
-     * This method return first album of current shelf or null if shelf haven't albums.
-     *
-     * @return first album of shelf or null
-     */
-    public Album getFirstAlbum() {
-        if (this.albums.size() > 0) {
-            return this.albums.get(0);
-        }
-        return null;
-    }
-    
-    /**
-     * Return relative path of this shelf in file-system(relative to uploadRoot parameter)
-     *
-     */
-    public String getPath(){
-		if(getOwner() != null && getOwner().getPath() != null){
-			return getOwner().getPath() + this.getId().toString() + File.separator;
+	/**
+	 * @return List of unvisited images
+	 */
+	public List<Image> getUnvisitedImages() {
+		final List<Image> unvisitedImages = new ArrayList<Image>();
+		for (Album a : getAlbums()) {
+			unvisitedImages.addAll(a.getUnvisitedImages());
 		}
-		return null;
+		return unvisitedImages;
 	}
 
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+	/**
+	 * @return List of images, belongs to this shelf
+	 */
+	public List<Image> getImages() {
+		final List<Image> images = new ArrayList<Image>();
+		for (Album a : getAlbums()) {
+			images.addAll(a.getImages());
+		}
+		return images;
+	}
 
-        Shelf shelf = (Shelf) o;
+	/**
+	 * This method add album to collection of albums of current shelf
+	 *
+	 * @param album -
+	 *              album to add
+	 */
+	public void addAlbum(Album album) {
+		if (album == null) {
+			throw new IllegalArgumentException("Null album!");
+		}
+		
+		if (album.getShelf() != null
+				&& !album.getShelf().getAlbums().contains(this)) {
+			// remove from previous shelf
+			album.getShelf().removeAlbum(album);
+			album.setShelf(this);
+			albums.add(album);
+		}
+	}
 
-        if (id != null ? !id.equals(shelf.id) : shelf.id != null) return false;
-        if (owner != null ? !owner.equals(shelf.owner) : shelf.owner != null) return false;
-        if (!name.equals(shelf.name)) return false;
+	/**
+	 * This method remove album from collection of albums of album
+	 *
+	 * @param album -
+	 *              album to remove
+	 */
+	public void removeAlbum(Album album) {
+		if (album == null) {
+			throw new IllegalArgumentException("Null album!");
+		}
 
-        return true;
-    }
+		if (!album.getShelf().equals(this)) {
+			throw new IllegalArgumentException("This Shelf not contain this album!");
+		}
 
-    public int hashCode() {
-        int result;
-        result = (id != null ? id.hashCode() : 0);
-        result = 31 * result + name.hashCode();
-        result = 31 * result + (owner != null ? owner.hashCode() : 0);
-        return result;
-    }
+//		album.setShelf(null);
+		albums.remove(album);
+	}
+
+	/**
+	 * This method return first album of current shelf or null if shelf haven't albums.
+	 *
+	 * @return first album of shelf or null
+	 */
+	public Album getFirstAlbum() {
+		if (this.albums.isEmpty()) {
+			return null;
+		}
+
+		return this.albums.get(0);
+	}
+
+	/**
+	 * Return relative path of this shelf in file-system(relative to uploadRoot parameter)
+	 */
+	public String getPath() {
+		if (getOwner().getPath() == null) {
+			return null;
+		}
+		return getOwner().getPath() + this.getId().toString() + File.separator;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj) {
+			return true;
+		}
+
+		if (obj == null || getClass() != obj.getClass()) {
+			return false;
+		}
+
+		final Shelf shelf = (Shelf) obj;
+
+		return (id != null ? id.equals(shelf.getId()) : shelf.getId() == null)
+				&& (owner != null ? owner.equals(shelf.getOwner()) : shelf.getOwner() == null)
+				&& name.equals(shelf.getName());
+	}
+
+	@Override
+	public int hashCode() {
+		int result = id != null ? id.hashCode() : 0;
+		result = 31 * result + name.hashCode();
+		result = 31 * result + (owner != null ? owner.hashCode() : 0);
+		return result;
+	}
+
+	@Override
+	public String toString() {
+		return "{id : "+getId()+", name : "+getName()+"}";
+	}
 }
\ No newline at end of file

Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/User.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/User.java	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/User.java	2009-04-25 14:32:30 UTC (rev 13863)
@@ -39,11 +39,15 @@
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
 import javax.persistence.UniqueConstraint;
+import javax.persistence.FetchType;
 
 import org.hibernate.validator.Email;
 import org.hibernate.validator.Length;
 import org.hibernate.validator.NotEmpty;
 import org.hibernate.validator.NotNull;
+import org.hibernate.annotations.LazyCollection;
+import org.hibernate.annotations.OrderBy;
+import org.hibernate.annotations.LazyCollectionOption;
 import org.jboss.seam.ScopeType;
 import org.jboss.seam.annotations.AutoCreate;
 import org.jboss.seam.annotations.Name;
@@ -51,95 +55,95 @@
 
 /**
  * Class for representing User Entity
- *  EJB3 Entity Bean
+ * EJB3 Entity Bean
  *
  * @author Andrey Markhel
  */
 
 @NamedQueries({
-    @NamedQuery(
-        name = "user-login",
-        query = "from User u where u.login = :username and u.passwordHash = :password"
-   ),
-   @NamedQuery(
-        name = "user-exist",
-        query = "from User u where u.login = :login"
-   ),
-   @NamedQuery(
-	    name = "user-user",
-	    query = "from User u where u.login = :login"
-	   )
-})
+	@NamedQuery(
+			name = "user-login",
+			query = "select u from User u where u.login = :username and u.passwordHash = :password"
+	),
+	@NamedQuery(
+			name = "user-exist",
+			query = "select u from User u where u.login = :login"
+	),
+	@NamedQuery(
+			name = "user-user",
+			query = "select u from User u where u.login = :login"
+	)
+		})
 
 @Entity
 @Scope(ScopeType.SESSION)
 @Name("user")
 @AutoCreate
- at Table(name = "Users", uniqueConstraints = {
-		@UniqueConstraint(columnNames = "login"),
-		@UniqueConstraint(columnNames = "email")
-		})
+ at Table(uniqueConstraints = {
+	@UniqueConstraint(columnNames = "login"),
+	@UniqueConstraint(columnNames = "email")
+		}
+)
 public class User implements Serializable {
-	
+
 	private static final long serialVersionUID = 1L;
-	
+
 	@Id
 	@GeneratedValue
-	@Column(name = "USER_ID")
-	private Long id = null;
-	
-	@NotNull 
+	private Long id;
+
+	@NotNull
 	private String passwordHash;
-	
+
+	@NotNull
+	@NotEmpty
+	@Length(min = 3)
 	@Column(length = 255, nullable = false)
-    @NotNull
+	private String firstName;
+
+	@NotNull
 	@NotEmpty
-    @Length(min=3)
-	private String firstName;
-	
+	@Length(min = 3)
 	@Column(length = 255, nullable = false)
-    @NotNull
-    @NotEmpty
-    @Length(min=3)
 	private String secondName;
-	
+
 	@Column(length = 255, nullable = false)
-    @NotNull
-    @NotEmpty
-    @Email
+	@NotNull
+	@NotEmpty
+	@Email
 	private String email;
-	
+
 	@Column(length = 255, nullable = false)
-    @NotNull
-    @NotEmpty
-    @Length(min=3)
+	@NotNull
+	@NotEmpty
+	@Length(min = 3)
 	private String login;
-	
+
 	@Transient
 	@NotNull
-    @NotEmpty
-    @Length(min=3)
+	@NotEmpty
+	@Length(min = 3)
 	private String password;
-	
+
 	@Transient
 	@NotNull
-    @NotEmpty
-    @Length(min=3)
+	@NotEmpty
+	@Length(min = 3)
 	private String confirmPassword;
-	
+
 	@Temporal(TemporalType.TIMESTAMP)
 	private Date birthDate;
-	
+
 	@NotNull
 	private Sex sex;
-	
+
 	private Boolean hasAvatar;
-	
-	@OneToMany(mappedBy = "owner", cascade = { CascadeType.ALL})
-    @org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
-    @org.hibernate.annotations.OrderBy(clause = "NAME asc")
-    private List<Shelf> shelves = new ArrayList<Shelf>();
-	
+
+	@OrderBy(clause = "NAME asc")
+	@OneToMany(mappedBy = "owner", cascade = CascadeType.ALL)
+	@LazyCollection(LazyCollectionOption.EXTRA)
+	private List<Shelf> shelves = new ArrayList<Shelf>();
+
 	private boolean preDefined;
 
 	public boolean isPreDefined() {
@@ -175,14 +179,14 @@
 		this.email = email;
 	}
 
-	public String getPasswordHash(){ 
-		return passwordHash; 
+	public String getPasswordHash() {
+		return passwordHash;
 	}
-	
+
 	public void setPasswordHash(String passwordHash) {
 		this.passwordHash = passwordHash;
 	}
-	
+
 	public String getLogin() {
 		return login;
 	}
@@ -210,7 +214,7 @@
 	public Long getId() {
 		return id;
 	}
-	
+
 	public String getConfirmPassword() {
 		return confirmPassword;
 	}
@@ -226,7 +230,7 @@
 	public void setShelves(List<Shelf> shelves) {
 		this.shelves = shelves;
 	}
-	
+
 	public Sex getSex() {
 		return sex;
 	}
@@ -242,91 +246,88 @@
 	public void setHasAvatar(Boolean hasAvatar) {
 		this.hasAvatar = hasAvatar;
 	}
-	
+
 	//---------------------------Business methods
-    
+
 	/**
-     * This method add shelf to collection of shelves, belongs to user
-     *
-     * @param shelf -
-     *              shelf to add
-     */
-    public void addShelf(Shelf shelf) {
-        if (shelf == null) {
-            throw new IllegalArgumentException("Null shelf!");
-        }    
-        if(!shelves.contains(shelf)){
-        	shelf.setOwner(this);
-            shelves.add(shelf);
-        }
-    }
+	 * This method add shelf to collection of shelves, belongs to user
+	 *
+	 * @param shelf -
+	 *              shelf to add
+	 */
+	public void addShelf(Shelf shelf) {
+		if (shelf == null) {
+			throw new IllegalArgumentException("Null shelf!");
+		}
+		if (!shelves.contains(shelf)) {
+			shelf.setOwner(this);
+			shelves.add(shelf);
+		}
+	}
 
-    /**
-     * This method remove shelf from collection of shelves, belongs to user
-     *
-     * @param shelf -
-     *              shelf to remove
-     */
-    public void removeShelf(Shelf shelf) {
-        if (shelf == null) {
-            throw new IllegalArgumentException("Null shelf");
-        }
-        if(shelf.getOwner().getLogin().equals(this.getLogin())){
-        	shelf.setOwner(null);
-            shelves.remove(shelf);
-        }else{
-        	throw new IllegalArgumentException("Shelf not belongs to this user!");
-        }
-    }
-	
 	/**
-     * Return relative path of folder with user's images in file-system(relative to uploadRoot parameter)
-     *
-     */
-	public String getPath(){
-		if(this.getId() != null){
-			return File.separator + this.getLogin().toString() + File.separator;
+	 * This method remove shelf from collection of shelves, belongs to user
+	 *
+	 * @param shelf -
+	 *              shelf to remove
+	 */
+	public void removeShelf(Shelf shelf) {
+		if (shelf == null) {
+			throw new IllegalArgumentException("Null shelf");
 		}
-		return null;
+		if (shelf.getOwner().getLogin().equals(this.getLogin())) {
+			shelf.setOwner(null);
+			shelves.remove(shelf);
+		} else {
+			throw new IllegalArgumentException("Shelf not belongs to this user!");
+		}
 	}
 
 	/**
-     * This method return all images, belongs to user
-     *
-     * @return images, belongs to user
-     */
+	 * Return relative path of folder with user's images in file-system(relative to uploadRoot parameter)
+	 */
+	public String getPath() {
+		if (this.getId() == null) {
+			return null;
+		}
+		return File.separator + this.getLogin() + File.separator;
+	}
+
+	/**
+	 * This method return all images, belongs to user
+	 *
+	 * @return images, belongs to user
+	 */
 	public List<Image> getImages() {
-		List<Image> images = new ArrayList<Image>();
+		final List<Image> images = new ArrayList<Image>();
 		for (Shelf s : getShelves()) {
-			for (Album a : s.getAlbums()) {
-				images.addAll(a.getImages());
-			}
+			images.addAll(s.getImages());
 		}
 		return images;
 	}
 
 	/**
 	 * This method return all albums, belongs to user
-	 * 
+	 *
 	 * @return albums, belongs to user
 	 */
 	public List<Album> getAlbums() {
-		List<Album> albums = new ArrayList<Album>();
+		final List<Album> albums = new ArrayList<Album>();
 		for (Shelf s : getShelves()) {
 			albums.addAll(s.getAlbums());
 		}
 		return albums;
 	}
-	
+
 	/**
-     * This method return all images, belongs to user
-     *
-     * @return images, belongs to user
-     */
+	 * This method return all images, belongs to user
+	 *
+	 * @return images, belongs to user
+	 */
 	public List<Image> getSharedImages() {
-		List<Image> images = new ArrayList<Image>();
+		final List<Image> images = new ArrayList<Image>();
 		for (Shelf s : getShelves()) {
-			if(!s.isShared()){
+			if (!s.isShared()) {
 				continue;
 			}
 			for (Album a : s.getAlbums()) {
@@ -338,17 +339,36 @@
 
 	/**
 	 * This method return all albums, belongs to user
-	 * 
+	 *
 	 * @return albums, belongs to user
 	 */
 	public List<Album> getSharedAlbums() {
-		List<Album> albums = new ArrayList<Album>();
+		final List<Album> albums = new ArrayList<Album>();
 		for (Shelf s : getShelves()) {
-			if(!s.isShared()){
+			if (!s.isShared()) {
 				continue;
 			}
 			albums.addAll(s.getAlbums());
 		}
 		return albums;
 	}
+
+	public boolean equals(final Object o) {
+		if (this == o) return true;
+		if (o == null || getClass() != o.getClass()) return false;
+
+		final User user = (User) o;
+
+		if (id != null ? !id.equals(user.id) : user.id != null) return false;
+		if (login != null ? !login.equals(user.login) : user.login != null)
+			return false;
+
+		return true;
+	}
+
+	public int hashCode() {
+		int result = id != null ? id.hashCode() : 0;
+		result = 31 * result + (login != null ? login.hashCode() : 0);
+		return result;
+	}
 }
\ No newline at end of file

Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/AlbumAction.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/AlbumAction.java	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/AlbumAction.java	2009-04-25 14:32:30 UTC (rev 13863)
@@ -27,10 +27,11 @@
 import org.jboss.seam.annotations.In;
 import org.jboss.seam.annotations.Name;
 import org.richfaces.photoalbum.domain.Album;
+import org.richfaces.photoalbum.domain.Shelf;
 
 /**
  * Class for manipulating with album entity. Analogous to DAO pattern.
- *  EJB3 Bean
+ * EJB3 Bean
  *
  * @author Andrey Markhel
  */
@@ -39,57 +40,57 @@
 @AutoCreate
 public class AlbumAction implements IAlbumAction {
 
-	@In(value="entityManager")
+	@In(value = "entityManager")
 	EntityManager em;
 
 	/**
-     * Persist album entity to database
-     * @param album - album to add
+	 * Persist album entity to database
+	 *
+	 * @param album - album to add
 	 * @throws PhotoAlbumException
-     */
+	 */
 	public void addAlbum(Album album) throws PhotoAlbumException {
-		try{
-		em.persist(album);
-		//Add to shelf
-		album.getShelf().addAlbum(album);
-		em.flush();
+		try {
+			em.persist(album);
+			//Add to shelf
+			album.getShelf().addAlbum(album);
+			em.flush();
+		} catch (Exception e) {
+			throw new PhotoAlbumException(e.getMessage());
 		}
-        catch(Exception e){
-        	throw new PhotoAlbumException(e.getMessage());
-        }
 	}
-	
+
 	/**
-     * Remove album entity from database
-     * @param album - album to delete
+	 * Remove album entity from database
+	 *
+	 * @param album - album to delete
 	 * @throws PhotoAlbumException
-     */
+	 */
 	public void deleteAlbum(Album album) throws PhotoAlbumException {
-		try{
-		if(album.getShelf() == null){
-			return;
+		final Shelf shelf = album.getShelf();
+		try {
+			album.setCoveringImage(null);
+
+			em.remove(album);
+			em.flush();
+
+			em.refresh(shelf);
+		} catch (Exception e) {
+			throw new PhotoAlbumException(e.getMessage());
 		}
-		//Remove from previous shelf 
-		album.getShelf().removeAlbum(album);
-		em.remove(album);
-		em.flush();
-		}
-        catch(Exception e){
-        	throw new PhotoAlbumException(e.getMessage());
-        }
 	}
-	
+
 	/**
-     * Synchronize state of album entity with database
-     * @param album - album to Synchronize
+	 * Synchronize state of album entity with database
+	 *
+	 * @param album - album to Synchronize
 	 * @throws PhotoAlbumException
-     */
+	 */
 	public void editAlbum(Album album) throws PhotoAlbumException {
-		try{
-		em.flush();
+		try {
+			em.flush();
+		} catch (Exception e) {
+			throw new PhotoAlbumException(e.getMessage());
 		}
-        catch(Exception e){
-        	throw new PhotoAlbumException(e.getMessage());
-        }
 	}
 }

Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/ImageAction.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/ImageAction.java	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/ImageAction.java	2009-04-25 14:32:30 UTC (rev 13863)
@@ -56,14 +56,12 @@
      */
     public void deleteImage(Image image) throws PhotoAlbumException {
     	try{
-    	if(image.getAlbum().getCoveringImage().equals(image)){
-    		image.getAlbum().setCoveringImage(null);
-    	}
-        image.getAlbum().removeImage(image);
-        em.remove(image);
-        em.flush();
-    	}
-        catch(Exception e){
+			image.getAlbum().removeImage(image);
+			image.setImageTags(null);
+
+			em.remove(image);
+			em.flush();
+    	} catch(Exception e){
         	throw new PhotoAlbumException(e.getMessage());
         }
     }
@@ -78,15 +76,15 @@
     	try{
     	if(metatagsChanged){
     		//Create cash of metatags early associated with image
-            List<MetaTag> removals = new ArrayList<MetaTag>(image.getImageTags());
+            final List<MetaTag> removals = new ArrayList<MetaTag>(image.getImageTags());
             
             //Get string representation of current metatgs, associated with image and split them by comma
-            String[] tokens = image.getMetaString().split(Constants.COMMA);
+            final String[] tokens = image.getMetaString().split(Constants.COMMA);
             
             //Populate set of tokens - 'candidates to metatags'
-            Set<String> toks = new HashSet<String>();
+            final Set<String> toks = new HashSet<String>();
             for (String s : tokens) {
-            	if(!s.equals("")){
+            	if(!"".equals(s)){
             		toks.add(s.trim());
             	}
             }
@@ -157,9 +155,10 @@
     public void deleteComment(Comment comment) throws PhotoAlbumException {
     	try{
     		em.remove(comment);
-    		comment.getImage().removeComment(comment);
     		em.flush();
-    	}
+
+			em.refresh(comment.getImage());
+		}
         catch(Exception e){
         	throw new PhotoAlbumException(e.getMessage());
         }
@@ -187,7 +186,7 @@
      * @return metatag object or null
      */
     public MetaTag getTagByName(String tag) {
-        MetaTag t;
+        final MetaTag t;
         try {
             t = (MetaTag) em.createNamedQuery(Constants.TAG_BY_NAME_QUERY).setParameter(Constants.TAG_PARAMETER, tag).getSingleResult();
         } catch (NoResultException nre) {

Modified: trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
===================================================================
--- trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java	2009-04-25 14:27:43 UTC (rev 13862)
+++ trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java	2009-04-25 14:32:30 UTC (rev 13863)
@@ -100,7 +100,7 @@
 			pushEvent(Constants.ADD_ERROR_EVENT, Constants.HAVENT_ACCESS);
 			return;
 		}
-		FileManager fileManager = (FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
+		final FileManager fileManager = (FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
 		if(!fileManager.isFilePresent(image.getFullPath())){
 			pushEvent(Constants.ADD_ERROR_EVENT, Constants.IMAGE_RECENTLY_DELETED_ERROR);
 			model.resetModel(NavigationEnum.ALBUM_PREVIEW, image.getAlbum().getOwner(), image.getAlbum().getShelf(), image.getAlbum(), null, image.getAlbum().getImages());
@@ -116,7 +116,7 @@
 			pushEvent(Constants.ADD_ERROR_EVENT, Constants.HAVENT_ACCESS);
 			return;
 		}
-		model.resetModel(NavigationEnum.ALBUM_IMAGE_EDIT, image.getAlbum().getShelf().getOwner(), image.getAlbum().getShelf(), image.getAlbum(), image, image.getAlbum().getImages());		
+		model.resetModel(NavigationEnum.ALBUM_IMAGE_EDIT, image.getOwner(), image.getAlbum().getShelf(), image.getAlbum(), image, image.getAlbum().getImages());
 	}
 	
 	@Restrict("#{s:hasRole('admin')}")
@@ -135,7 +135,7 @@
 	}
 	
 	public void showShelf(Shelf shelf){
-		FileManager fileManager = (FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
+		final FileManager fileManager = (FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
 		if(!fileManager.isDirectoryPresent(shelf.getPath())){
 			pushEvent(Constants.ADD_ERROR_EVENT, Constants.SHELF_RECENTLY_DELETED_ERROR);
 			model.resetModel(NavigationEnum.ANONYM, shelf.getOwner(), null, null, null, null);
@@ -146,20 +146,20 @@
 	
 	@Restrict("#{s:hasRole('admin')}")
 	public void startEditAlbum(Album album){
-		if(!album.getOwner().getLogin().equals(user.getLogin())){
+		if(album.isOwner(user)) {
 			pushEvent(Constants.ADD_ERROR_EVENT, Constants.HAVENT_ACCESS);
 			return;
 		}
-		model.resetModel(NavigationEnum.ALBUM_EDIT, album.getShelf().getOwner(), album.getShelf(), album, null, album.getImages());
+		model.resetModel(NavigationEnum.ALBUM_EDIT, album.getOwner(), album.getShelf(), album, null, album.getImages());
 	}
 	
 	public void cancelEditAlbum(){
-		model.resetModel(NavigationEnum.ALBUM_PREVIEW, model.getSelectedAlbum().getShelf().getOwner(), model.getSelectedAlbum().getShelf(), model.getSelectedAlbum(), null, model.getSelectedAlbum().getImages());
+		model.resetModel(NavigationEnum.ALBUM_PREVIEW, model.getSelectedAlbum().getOwner(), model.getSelectedAlbum().getShelf(), model.getSelectedAlbum(), null, model.getSelectedAlbum().getImages());
 	}
 	
 	@Observer(Constants.ALBUM_ADDED_EVENT)
 	public void onAlbumAdded(Album album){
-		model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getShelf().getOwner(), album.getShelf(), album, null, album.getImages());
+		model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getOwner(), album.getShelf(), album, null, album.getImages());
 	}
 	
 	@Observer(Constants.ALBUM_EDITED_EVENT)
@@ -244,7 +244,7 @@
 	}
 	
 	public void showUnvisitedImages(Album album){
-		model.resetModel(NavigationEnum.ALBUM_UNVISITED, album.getShelf().getOwner(), album.getShelf(), album, null, album.getUnvisitedImages());
+		model.resetModel(NavigationEnum.ALBUM_UNVISITED, album.getOwner(), album.getShelf(), album, null, album.getUnvisitedImages());
 	}
 
 	public void showTag(MetaTag metatag){
@@ -266,51 +266,42 @@
 	}
 	
 	public Integer getPage(){
-		Integer index = model.getSelectedAlbum().getIndex(model.getSelectedImage());
-		return index/5 + 1;
+		final Integer index = model.getSelectedAlbum().getIndex(model.getSelectedImage());
+		return index / 5 + 1;
 	}
 	
 	public boolean isUserImage(Image image){
-		if(image == null || image.getAlbum() == null || image.getAlbum().getOwner() == null){
+		if(image == null || image.getOwner() == null) {
 			return false;
 		}
-		return image.getAlbum().getOwner().getLogin().equals(user.getLogin());
+		return image.isOwner(user);
 	}
 	
 	public boolean isUserShelf(Shelf shelf){
-		return shelf.getOwner()!=null && shelf.getOwner().getLogin().equals(user.getLogin());
+		return shelf.isOwner(user);
 	}
 	
 	public boolean isUserAlbum(Album album){
-		if(album == null || album.getOwner() == null){
-			return false;
-		}
-		return album.getOwner().getLogin().equals(user.getLogin());
+		return album != null && album.isOwner(user);
 	}
 	
 	private boolean canViewShelf(Shelf shelf) {
-		return shelf.getOwner().getLogin().equals(user.getLogin());
+		return shelf.isOwner(user);
 	}
 	
+	private boolean canViewAlbum(Album album) {
+		return album.getShelf().isShared() || album.isOwner(user);
+	}
+
 	private boolean canViewImage(Image image) {
-		return image.getAlbum().getShelf().isShared() || image.getAlbum().getOwner().getLogin().equals(user.getLogin());
+		return image.getAlbum().getShelf().isShared() || image.isOwner(user);
 	}
 	
-	private boolean canViewAlbum(Album album) {
-		return album.getShelf().isShared() || album.getOwner().getLogin().equals(user.getLogin());
-	}
-	
 	private void pushEvent(String type, Object... parameters) {
 		Events.instance().raiseEvent(type, parameters);
 	}
 	
 	public boolean isProfileEditable(User selectedUser){
-		if(selectedUser == null){
-			return false;
-		}
-		if(selectedUser.getLogin().equals(user.getLogin())){
-			return true;
-		}
-		return false;
+		return selectedUser != null && selectedUser.equals(user);
 	}
 }
\ No newline at end of file




More information about the richfaces-svn-commits mailing list