commit dce0fa4c247098daf825cc6818e7fcddda83d363
Author: m.doering <m.doering@localhost>
Date:   Wed Nov 21 16:15:02 2007 +0000

    Initial import.

diff --git a/.gitattributes b/.gitattributes
index eb0bafaeae..0eb93af002 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -243,6 +243,22 @@ cdmlibrary/src/test/java/extern/TestJarMain.java -text
 cdmlibrary/src/test/resources/applicationContext-test.xml -text
 docs/layers.graffle -text
 docs/layers.png -text
+musiclib-hibernatetest/listAnnotatedClasses.py -text
+musiclib-hibernatetest/pom.xml -text
+musiclib-hibernatetest/src/main/java/org/bgbm/model/Address.java -text
+musiclib-hibernatetest/src/main/java/org/bgbm/model/AnnotatableEntity.java -text
+musiclib-hibernatetest/src/main/java/org/bgbm/model/Annotation.java -text
+musiclib-hibernatetest/src/main/java/org/bgbm/model/Contact.java -text
+musiclib-hibernatetest/src/main/java/org/bgbm/model/Person.java -text
+musiclib-hibernatetest/src/main/java/org/bgbm/model/package-info.java -text
+musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/AgentDaoHibernateImpl.java -text
+musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/DaoBase.java -text
+musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/IAgentDao.java -text
+musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/IDao.java -text
+musiclib-hibernatetest/src/main/resources/applicationContext.xml -text
+musiclib-hibernatetest/src/main/resources/log4j.properties -text
+musiclib-hibernatetest/src/main/resources/sessionfactory.xml -text
+musiclib-hibernatetest/src/site/site.xml -text
 updateSite/.project -text
 updateSite/features/eu.etaxonomy.cdmLibrary_0.2.5.jar -text
 updateSite/index.html -text
diff --git a/musiclib-hibernatetest/listAnnotatedClasses.py b/musiclib-hibernatetest/listAnnotatedClasses.py
new file mode 100644
index 0000000000..9cc59ea914
--- /dev/null
+++ b/musiclib-hibernatetest/listAnnotatedClasses.py
@@ -0,0 +1,17 @@
+#!/usr/bin/python
+import os, sys
+
+modelDir="src/main/java/eu/etaxonomy/cdm/model"
+modelPackage="eu.etaxonomy.cdm.model"
+
+print"<list>"
+for path,dirs,files in os.walk(modelDir):
+    if path <> modelDir:
+        package = "%s.%s"%(modelPackage, path[len(modelDir)+1:])
+    else:
+        package = modelPackage
+    for f in files: 
+        if f.endswith(".java") and f <> "package-info.java":
+            print "<value>%s.%s</value>" %(package, f[:-5])
+print"</list>"
+
diff --git a/musiclib-hibernatetest/pom.xml b/musiclib-hibernatetest/pom.xml
new file mode 100644
index 0000000000..2bb475b99e
--- /dev/null
+++ b/musiclib-hibernatetest/pom.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+    >
+  <parent>
+    <artifactId>cdmParent</artifactId>
+    <groupId>eu.etaxonomy</groupId>
+    <version>0.1</version>
+    <relativePath>../cdmParent/pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>musiclib</artifactId>
+  <name>Markus Music Test</name>
+  <version>0.1.0</version>
+  <description>EDIT cdm library</description>
+  <scm>
+    <connection>scm:svn:http://ww2.biocase.org/svn/edit/trunk/cdmlib/musiclib/</connection>
+    <developerConnection>scm:svn:https://ww2.biocase.org/svn/edit/trunk/cdmlib/musiclib/</developerConnection>
+    <url>http://ww2.biocase.org/svn/edit/trunk/cdmlib/musiclib/</url>
+  </scm>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <includes>
+            <include>**/*Test.java</include>
+          </includes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>javax.persistence</groupId>
+      <artifactId>ejb</artifactId>
+      <version>3</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.xml</groupId>
+      <artifactId>jaxrpc-api</artifactId>
+      <version>1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.xml.bind</groupId>
+      <artifactId>jaxb-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+      <version>5.0.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-commons-annotations</artifactId>
+      <version>3.3.0.ga</version>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-annotations</artifactId>
+      <version>3.3.0.ga</version>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate</artifactId>
+      <version>3.2.5.ga</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring</artifactId>
+      <version>2.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+      <version>2.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-orm</artifactId>
+      <version>2.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-jdbc</artifactId>
+      <version>2.5</version>
+    </dependency>    
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
+      <version>2.5</version>
+    </dependency>
+  </dependencies>
+</project>
+
diff --git a/musiclib-hibernatetest/src/main/java/org/bgbm/model/Address.java b/musiclib-hibernatetest/src/main/java/org/bgbm/model/Address.java
new file mode 100644
index 0000000000..66ac8ccced
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/java/org/bgbm/model/Address.java
@@ -0,0 +1,126 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.model.agent;
+
+
+import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry;
+import eu.etaxonomy.cdm.model.location.Point;
+import eu.etaxonomy.cdm.model.common.VersionableEntity;
+import org.apache.log4j.Logger;
+import eu.etaxonomy.cdm.model.Description;
+import java.util.*;
+import javax.persistence.*;
+
+/**
+ * taken from TDWG & VCard  http://rs.tdwg.
+ * org/ontology/voc/ContactDetails#Address
+ * @author m.doering
+ * @version 1.0
+ * @created 08-Nov-2007 13:06:09
+ */
+@Entity
+public class Address extends VersionableEntity {
+	static Logger logger = Logger.getLogger(Address.class);
+	//Post Office Box
+	private String pobox;
+	//including number
+	private String street;
+	private String postcode;
+	//town,locality,suburb
+	private String locality;
+	//Region/State
+	private String region;
+	private WaterbodyOrCountry country;
+	private Point location;
+	public WaterbodyOrCountry getCountry(){
+		return this.country;
+	}
+
+	/**
+	 * 
+	 * @param country    country
+	 */
+	public void setCountry(WaterbodyOrCountry country){
+		this.country = country;
+	}
+
+	public Point getLocation(){
+		return this.location;
+	}
+
+	/**
+	 * 
+	 * @param location    location
+	 */
+	public void setLocation(Point location){
+		this.location = location;
+	}
+
+	public String getPobox(){
+		return this.pobox;
+	}
+
+	/**
+	 * 
+	 * @param pobox    pobox
+	 */
+	public void setPobox(String pobox){
+		this.pobox = pobox;
+	}
+
+	public String getStreet(){
+		return this.street;
+	}
+
+	/**
+	 * 
+	 * @param street    street
+	 */
+	public void setStreet(String street){
+		this.street = street;
+	}
+
+	public String getPostcode(){
+		return this.postcode;
+	}
+
+	/**
+	 * 
+	 * @param postcode    postcode
+	 */
+	public void setPostcode(String postcode){
+		this.postcode = postcode;
+	}
+
+	public String getLocality(){
+		return this.locality;
+	}
+
+	/**
+	 * 
+	 * @param locality    locality
+	 */
+	public void setLocality(String locality){
+		this.locality = locality;
+	}
+
+	public String getRegion(){
+		return this.region;
+	}
+
+	/**
+	 * 
+	 * @param region    region
+	 */
+	public void setRegion(String region){
+		this.region = region;
+	}
+
+}
\ No newline at end of file
diff --git a/musiclib-hibernatetest/src/main/java/org/bgbm/model/AnnotatableEntity.java b/musiclib-hibernatetest/src/main/java/org/bgbm/model/AnnotatableEntity.java
new file mode 100644
index 0000000000..bdd20afaec
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/java/org/bgbm/model/AnnotatableEntity.java
@@ -0,0 +1,87 @@
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        /**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.model.common;
+
+
+import org.apache.log4j.Logger;
+import eu.etaxonomy.cdm.model.Description;
+import java.util.*;
+
+import javax.persistence.*;
+
+/**
+ * @author m.doering
+ * @version 1.0
+ * @created 08-Nov-2007 13:06:10
+ */
+@MappedSuperclass
+public abstract class AnnotatableEntity extends VersionableEntity {
+	public AnnotatableEntity() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	static Logger logger = Logger.getLogger(AnnotatableEntity.class);
+	private Set<Marker> markers = new HashSet();
+	private Set<Annotation> annotations = new HashSet();
+	
+	
+	@OneToMany
+	public Set<Marker> getMarkers(){
+		return this.markers;
+	}
+
+	/**
+	 * 
+	 * @param marker    marker
+	 */
+	public void addMarker(Marker marker){
+
+	}
+
+	/**
+	 * 
+	 * @param marker    marker
+	 */
+	public void removeMarker(Marker marker){
+
+	}
+
+	@OneToMany
+	public Set<Annotation> getAnnotations(){
+		return this.annotations;
+	}
+
+	/**
+	 * @param annotations
+	 * 
+	 * @param annotation
+	 */
+	public void addAnnotations(Annotation annotation){
+
+	}
+
+	/**
+	 * 
+	 * @param annotation
+	 */
+	public void removeAnnotations(Annotation annotation){
+
+	}
+
+	public void setMarkers(Set<Marker> markers) {
+		this.markers = markers;
+	}
+
+	public void setAnnotations(Set<Annotation> annotations) {
+		this.annotations = annotations;
+	}
+
+}
\ No newline at end of file
diff --git a/musiclib-hibernatetest/src/main/java/org/bgbm/model/Annotation.java b/musiclib-hibernatetest/src/main/java/org/bgbm/model/Annotation.java
new file mode 100644
index 0000000000..4f789efeb3
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/java/org/bgbm/model/Annotation.java
@@ -0,0 +1,46 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.model.common;
+
+
+import eu.etaxonomy.cdm.model.agent.Person;
+import org.apache.log4j.Logger;
+import eu.etaxonomy.cdm.model.Description;
+import java.util.*;
+import javax.persistence.*;
+
+/**
+ * @author m.doering
+ * @version 1.0
+ * @created 08-Nov-2007 13:06:10
+ */
+@Entity
+public class Annotation extends LanguageString {
+	public Annotation(String text, Language lang) {
+		super(text, lang);
+	}
+
+	static Logger logger = Logger.getLogger(Annotation.class);
+	//Human annotation
+	private Person commentator;
+
+	public Person getCommentator(){
+		return this.commentator;
+	}
+
+	/**
+	 * 
+	 * @param commentator    commentator
+	 */
+	public void setCommentator(Person commentator){
+		this.commentator = commentator;
+	}
+
+}
\ No newline at end of file
diff --git a/musiclib-hibernatetest/src/main/java/org/bgbm/model/Contact.java b/musiclib-hibernatetest/src/main/java/org/bgbm/model/Contact.java
new file mode 100644
index 0000000000..a95f0f2d5c
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/java/org/bgbm/model/Contact.java
@@ -0,0 +1,107 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.model.agent;
+
+
+import eu.etaxonomy.cdm.model.common.VersionableEntity;
+import org.apache.log4j.Logger;
+import eu.etaxonomy.cdm.model.Description;
+import java.util.*;
+import javax.persistence.*;
+
+/**
+ * http://rs.tdwg.org/ontology/voc/ContactDetails#ContactDetails
+ * @author m.doering
+ * @version 1.0
+ * @created 08-Nov-2007 13:06:18
+ */
+@Entity
+public class Contact extends VersionableEntity {
+	public Contact() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	static Logger logger = Logger.getLogger(Contact.class);
+	private String email;
+	private String url;
+	private String phone;
+	private String fax;
+	private Set<Address> addresses;
+	
+	
+	@OneToMany
+	public Set<Address> getAddresses(){
+		return this.addresses;
+	}
+
+	/**
+	 * 
+	 * @param addresses    addresses
+	 */
+	public void setAddresses(Set<Address> addresses){
+		this.addresses = addresses;
+	}
+	public void addAddress(Address address){
+		this.addresses.add(address);
+	}
+	public void removeAddress(Address address){
+		this.addresses.remove(address);
+	}
+
+	public String getEmail(){
+		return this.email;
+	}
+
+	/**
+	 * 
+	 * @param email    email
+	 */
+	public void setEmail(String email){
+		this.email = email;
+	}
+
+	public String getUrl(){
+		return this.url;
+	}
+
+	/**
+	 * 
+	 * @param url    url
+	 */
+	public void setUrl(String url){
+		this.url = url;
+	}
+
+	public String getPhone(){
+		return this.phone;
+	}
+
+	/**
+	 * 
+	 * @param phone    phone
+	 */
+	public void setPhone(String phone){
+		this.phone = phone;
+	}
+
+	public String getFax(){
+		return this.fax;
+	}
+
+	/**
+	 * 
+	 * @param fax    fax
+	 */
+	public void setFax(String fax){
+		this.fax = fax;
+	}
+
+}
\ No newline at end of file
diff --git a/musiclib-hibernatetest/src/main/java/org/bgbm/model/Person.java b/musiclib-hibernatetest/src/main/java/org/bgbm/model/Person.java
new file mode 100644
index 0000000000..a88b0f6dfd
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/java/org/bgbm/model/Person.java
@@ -0,0 +1,159 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.model.agent;
+
+
+import eu.etaxonomy.cdm.model.common.TimePeriod;
+import eu.etaxonomy.cdm.model.common.Keyword;
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import org.apache.log4j.Logger;
+import eu.etaxonomy.cdm.model.Description;
+import java.util.*;
+import javax.persistence.*;
+
+/**
+ * http://rs.tdwg.org/ontology/voc/Person.rdf
+ * @author m.doering
+ * @version 1.0
+ * @created 08-Nov-2007 13:06:42
+ */
+@Entity
+public class Person extends Agent {
+	public Person() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+	
+	static Logger logger = Logger.getLogger(Person.class);
+	//e.g. the title
+	private String prefix;
+	//All other names not included in the surname. May be just initials, all forenames in full or a combination of expanded
+	//names and initials.
+	private String firstname;
+	//A hereditary name common to all members of a family, as distinct from a given name or forename
+	private String lastname;
+	//e.g. junior
+	private String suffix;
+	//The period for which this person was alive represented as a TimePeriod datatype, i.e. start - end date. Alternative
+	//suggestion as a flexible String. the form birthdate - deathdate (XXXX - YYYY; XXXX - or - YYYY as appropriate) is
+	//prefered, or as simple flourished date (fl. XXXX) may be given where that is all that is known
+	private TimePeriod lifespan;
+	private Set<InstitutionalMembership> institutionalMemberships;
+	private Contact contact;
+	private Set<Keyword> keywords;
+
+	@OneToMany
+	public Set<InstitutionalMembership> getInstitutionalMemberships(){
+		return this.institutionalMemberships;
+	}
+
+	/**
+	 * 
+	 * @param institutionalMemberships    institutionalMemberships
+	 */
+	public void setInstitutionalMemberships(Set<InstitutionalMembership> institutionalMemberships){
+		this.institutionalMemberships = institutionalMemberships;
+	}
+
+
+	@OneToMany
+	public Set<Keyword> getKeywords(){
+		return this.keywords;
+	}
+	public void setKeywords(Set<Keyword> keywords){
+		this.keywords = keywords;
+	}
+	public void addKeyword(Keyword keyword){
+		this.keywords.add(keyword);
+	}
+	public void removeKeyword(Keyword keyword){
+		this.keywords.remove(keyword);
+	}
+
+
+
+	public Contact getContact(){
+		return this.contact;
+	}
+
+	/**
+	 * 
+	 * @param contact    contact
+	 */
+	public void setContact(Contact contact){
+		this.contact = contact;
+	}
+
+	public String getPrefix(){
+		return this.prefix;
+	}
+
+	/**
+	 * 
+	 * @param prefix    prefix
+	 */
+	public void setPrefix(String prefix){
+		this.prefix = prefix;
+	}
+
+	public String getFirstname(){
+		return this.firstname;
+	}
+
+	/**
+	 * 
+	 * @param firstname    firstname
+	 */
+	public void setFirstname(String firstname){
+		this.firstname = firstname;
+	}
+
+	public String getLastname(){
+		return this.lastname;
+	}
+
+	/**
+	 * 
+	 * @param lastname    lastname
+	 */
+	public void setLastname(String lastname){
+		this.lastname = lastname;
+	}
+
+	public String getSuffix(){
+		return this.suffix;
+	}
+
+	/**
+	 * 
+	 * @param suffix    suffix
+	 */
+	public void setSuffix(String suffix){
+		this.suffix = suffix;
+	}
+
+	public TimePeriod getLifespan(){
+		return this.lifespan;
+	}
+
+	/**
+	 * 
+	 * @param lifespan    lifespan
+	 */
+	public void setLifespan(TimePeriod lifespan){
+		this.lifespan = lifespan;
+	}
+
+	@Override
+	public String generateTitle(){
+		return "";
+	}
+
+}
\ No newline at end of file
diff --git a/musiclib-hibernatetest/src/main/java/org/bgbm/model/package-info.java b/musiclib-hibernatetest/src/main/java/org/bgbm/model/package-info.java
new file mode 100644
index 0000000000..400cce3c67
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/java/org/bgbm/model/package-info.java
@@ -0,0 +1,9 @@
+/* Package Annotations*/
+
+@GenericGenerator(
+		name="system-increment", 
+		strategy = "increment"
+)
+package eu.etaxonomy.cdm.model.common;
+
+import org.hibernate.annotations.GenericGenerator;	
\ No newline at end of file
diff --git a/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/AgentDaoHibernateImpl.java b/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/AgentDaoHibernateImpl.java
new file mode 100644
index 0000000000..7c7c7277a8
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/AgentDaoHibernateImpl.java
@@ -0,0 +1,25 @@
+package eu.etaxonomy.cdm.persistence.dao;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Repository;
+
+import eu.etaxonomy.cdm.model.agent.Agent;
+
+
+@Repository
+public class AgentDaoHibernateImpl extends DaoBase<Agent, Integer> implements IAgentDao{
+	private static final Logger logger = Logger.getLogger(AgentDaoHibernateImpl.class);
+
+	public AgentDaoHibernateImpl() {
+		super(Agent.class); 
+	}
+
+
+	@Override
+	public List<Agent> find(String queryString) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+}
diff --git a/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/DaoBase.java b/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/DaoBase.java
new file mode 100644
index 0000000000..5c7d17c8ae
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/DaoBase.java
@@ -0,0 +1,80 @@
+/**
+ * 
+ */
+package eu.etaxonomy.cdm.persistence.dao;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.DataAccessException;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+
+/**
+ * @author a.mueller
+ *
+ */
+public abstract class DaoBase<T extends CdmBase, ID extends Serializable> implements IDao<T, ID> {
+
+	static Logger logger = Logger.getLogger(DaoBase.class);
+
+	@Autowired
+	private SessionFactory factory;
+	protected Class<T> type;
+	
+	public DaoBase(Class<T> type){
+		this.type = type;
+		logger.debug("Creating DAO of type [" + type.getSimpleName() + "]");
+	}
+	
+	protected Session getSession(){
+		return factory.getCurrentSession();
+	}
+	
+	
+	public void saveOrUpdate(T transientObject) throws DataAccessException  {
+		getSession().saveOrUpdate(transientObject);
+	}
+
+	public Serializable save(T newInstance) throws DataAccessException {
+		return getSession().save(newInstance);
+	}
+	
+	public void update(T transientObject) throws DataAccessException {
+		getSession().update(transientObject);
+	}
+	
+	public void delete(T persistentObject) throws DataAccessException {
+		getSession().delete(persistentObject);
+	}
+
+	public T findById(Integer id) throws DataAccessException {
+		return (T) getSession().get(type, id);
+	}
+
+
+	
+	public Boolean exists(ID id) {
+		if (findById(id)==null){
+			return false;
+		}
+		return true;
+	}
+
+
+	public List<T> list(Integer limit) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+
+	/* (non-Javadoc)
+	 * @see eu.etaxonomy.cdm.persistence.dao.IDao#find(java.lang.String)
+	 */
+	public abstract List<T> find(String queryString);
+}
diff --git a/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/IAgentDao.java b/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/IAgentDao.java
new file mode 100644
index 0000000000..84e72080b6
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/IAgentDao.java
@@ -0,0 +1,7 @@
+package eu.etaxonomy.cdm.persistence.dao;
+
+import eu.etaxonomy.cdm.model.agent.Agent;
+
+public interface IAgentDao extends IDao<Agent,Integer> {
+	
+}
diff --git a/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/IDao.java b/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/IDao.java
new file mode 100644
index 0000000000..9074478c3f
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/java/org/bgbm/persistence/dao/IDao.java
@@ -0,0 +1,68 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.persistence.dao;
+
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.springframework.dao.DataAccessException;
+import org.springframework.orm.hibernate3.HibernateTemplate;
+
+import eu.etaxonomy.cdm.model.Description;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.Enumeration;
+
+/**
+ * an data access interface that all data access classes implement
+ * @author m.doering
+ * @version 1.0
+ * @created 02-Nov-2007 19:36:10
+ */
+public interface IDao<T extends CdmBase, ID extends Serializable> {
+	public void saveOrUpdate(T transientObject) throws DataAccessException;
+	
+	/* (non-Javadoc)
+	 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#save(java.lang.Object)
+	 */
+	public Serializable save(T newOrManagedObject) throws DataAccessException;
+	
+	/* (non-Javadoc)
+	 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#update(java.lang.Object)
+	 */
+	public void update(T transientObject) throws DataAccessException;
+	
+	/* (non-Javadoc)
+	 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#delete(java.lang.Object)
+	 */
+	public void delete(T persistentObject) throws DataAccessException;
+	
+	/* (non-Javadoc)
+	 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#findById(java.io.Serializable)
+	 */
+	public T findById(ID id) throws DataAccessException;
+
+//********************************************//	
+	
+	
+	/**
+	 * @param queryString
+	 * @return List<T extends CdmBase>
+	 * list object by searching on their title/lable.
+	 * common.Identifyable.getTitleCache if existing
+	 */
+	public List<T> find(String queryString);
+
+	public Boolean exists(ID id);
+
+	public List<T> list(Integer limit);
+
+}
diff --git a/musiclib-hibernatetest/src/main/resources/applicationContext.xml b/musiclib-hibernatetest/src/main/resources/applicationContext.xml
new file mode 100644
index 0000000000..40d2bbec64
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/resources/applicationContext.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:context="http://www.springframework.org/schema/context"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans 
+    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+    http://www.springframework.org/schema/context
+    http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+        
+    <import resource="sessionfactory.xml"/>
+    
+    <bean id="mysqlDataSource" 
+        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
+        <property name="url" value="jdbc:mysql://192.168.2.10/cdm_test"/>
+        <property name="username" value="edit"/>
+        <property name="password" value="wp5"/>
+    </bean>
+        
+</beans>
+
diff --git a/musiclib-hibernatetest/src/main/resources/log4j.properties b/musiclib-hibernatetest/src/main/resources/log4j.properties
new file mode 100644
index 0000000000..6f608df258
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/resources/log4j.properties
@@ -0,0 +1,56 @@
+### ************ APPENDER ***********************************###
+
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### direct messages to file hibernate.log ###
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.File=hibernate.log
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+
+### ************* LOG LEVELS *********************************###
+
+### set log levels - for more verbose logging change 'info' to 'debug' ###
+
+log4j.rootLogger=info, stdout
+
+	### *** CDM *** ###
+
+log4j.logger.eu.etaxonomy.cdm = debug 
+
+	### ***HIBERNATE ************ ###
+
+log4j.logger.org.hibernate=warn
+
+### log HQL query parser activity
+#log4j.logger.org.hibernate.hql.ast.AST=debug
+
+### log just the SQL
+#log4j.logger.org.hibernate.SQL=debug
+
+### log JDBC bind parameters ###
+log4j.logger.org.hibernate.type=info
+
+### log schema export/update ###
+log4j.logger.org.hibernate.tool.hbm2ddl=warn
+
+### log HQL parse trees
+#log4j.logger.org.hibernate.hql=debug
+
+### log cache activity ###
+#log4j.logger.org.hibernate.cache=debug
+
+### log transaction activity
+#log4j.logger.org.hibernate.transaction=debug
+
+### log JDBC resource acquisition
+log4j.logger.org.hibernate.jdbc=info
+
+### enable the following line if you want to track down connection ###
+### leakages when using DriverManagerConnectionProvider ###
+#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
diff --git a/musiclib-hibernatetest/src/main/resources/sessionfactory.xml b/musiclib-hibernatetest/src/main/resources/sessionfactory.xml
new file mode 100644
index 0000000000..0f16684fb6
--- /dev/null
+++ b/musiclib-hibernatetest/src/main/resources/sessionfactory.xml
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans 
+    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
+    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
+    ">
+    
+    <context:component-scan base-package="eu.etaxonomy.cdm"/>
+
+    <!-- enable the configuration of transactional behavior based on annotations -->
+    <tx:annotation-driven transaction-manager="transactionManager"/>    
+
+    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+        <property name="sessionFactory" ref="sessionFactory" />
+    </bean>
+    
+<bean id="sessionFactory" 
+    class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
+    <property name="dataSource" ref="mysqlDataSource"/>
+    <property name="annotatedPackages">
+        <list>
+            <value>eu.etaxonomy.cdm.model.common</value>
+        </list>
+    </property>
+    
+    <property name="annotatedClasses">
+        <list>
+            <value>eu.etaxonomy.cdm.model.Description</value>
+            <value>eu.etaxonomy.cdm.model.agent.Address</value>
+            <value>eu.etaxonomy.cdm.model.agent.Contact</value>
+            <value>eu.etaxonomy.cdm.model.agent.Institution</value>
+            <value>eu.etaxonomy.cdm.model.agent.InstitutionalMembership</value>
+            <value>eu.etaxonomy.cdm.model.agent.InstitutionType</value>
+            <value>eu.etaxonomy.cdm.model.agent.Person</value>
+            <value>eu.etaxonomy.cdm.model.agent.Team</value>
+            <value>eu.etaxonomy.cdm.model.common.AnnotatableEntity</value>
+            <value>eu.etaxonomy.cdm.model.common.Annotation</value>
+            <value>eu.etaxonomy.cdm.model.common.AudioFile</value>
+            <value>eu.etaxonomy.cdm.model.common.CdmBase</value>
+            <value>eu.etaxonomy.cdm.model.common.DefinedTermBase</value>
+            <value>eu.etaxonomy.cdm.model.common.EnumeratedTermBase</value>
+            <value>eu.etaxonomy.cdm.model.common.Enumeration</value>
+            <value>eu.etaxonomy.cdm.model.common.Extension</value>
+            <value>eu.etaxonomy.cdm.model.common.ExtensionType</value>
+            <value>eu.etaxonomy.cdm.model.common.Figure</value>
+            <value>eu.etaxonomy.cdm.model.common.IdentifiableEntity</value>
+            <value>eu.etaxonomy.cdm.model.common.ImageFile</value>
+            <value>eu.etaxonomy.cdm.model.common.IOriginalSource</value>
+            <value>eu.etaxonomy.cdm.model.common.IReferencedEntity</value>
+            <value>eu.etaxonomy.cdm.model.common.Keyword</value>
+            <value>eu.etaxonomy.cdm.model.common.Language</value>
+            <value>eu.etaxonomy.cdm.model.common.LanguageString</value>
+            <value>eu.etaxonomy.cdm.model.common.Marker</value>
+            <value>eu.etaxonomy.cdm.model.common.MarkerType</value>
+            <value>eu.etaxonomy.cdm.model.common.Media</value>
+            <value>eu.etaxonomy.cdm.model.common.MediaInstance</value>
+            <value>eu.etaxonomy.cdm.model.common.MovieFile</value>
+            <value>eu.etaxonomy.cdm.model.common.MultilanguageSet</value>
+            <value>eu.etaxonomy.cdm.model.common.OriginalSource</value>
+            <value>eu.etaxonomy.cdm.model.common.package-info</value>
+            <value>eu.etaxonomy.cdm.model.common.ReferencedEntityBase</value>
+            <value>eu.etaxonomy.cdm.model.common.ReferencedMedia</value>
+            <value>eu.etaxonomy.cdm.model.common.Representation</value>
+            <value>eu.etaxonomy.cdm.model.common.Rights</value>
+            <value>eu.etaxonomy.cdm.model.common.RightsTerm</value>
+            <value>eu.etaxonomy.cdm.model.common.TimePeriod</value>
+            <value>eu.etaxonomy.cdm.model.common.VersionableEntity</value>
+            <value>eu.etaxonomy.cdm.model.description.AbsenceTerm</value>
+            <value>eu.etaxonomy.cdm.model.description.CategoricalData</value>
+            <value>eu.etaxonomy.cdm.model.description.CharacterTree</value>
+            <value>eu.etaxonomy.cdm.model.description.CommonTaxonName</value>
+            <value>eu.etaxonomy.cdm.model.description.Description</value>
+            <value>eu.etaxonomy.cdm.model.description.Distribution</value>
+            <value>eu.etaxonomy.cdm.model.description.FeatureBase</value>
+            <value>eu.etaxonomy.cdm.model.description.FeatureType</value>
+            <value>eu.etaxonomy.cdm.model.description.IdentificationKey</value>
+            <value>eu.etaxonomy.cdm.model.description.IndividualsAssociation</value>
+            <value>eu.etaxonomy.cdm.model.description.MeasurementUnit</value>
+            <value>eu.etaxonomy.cdm.model.description.Modifier</value>
+            <value>eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase</value>
+            <value>eu.etaxonomy.cdm.model.description.PresenceTerm</value>
+            <value>eu.etaxonomy.cdm.model.description.QuantitativeData</value>
+            <value>eu.etaxonomy.cdm.model.description.Scope</value>
+            <value>eu.etaxonomy.cdm.model.description.Sex</value>
+            <value>eu.etaxonomy.cdm.model.description.Stage</value>
+            <value>eu.etaxonomy.cdm.model.description.State</value>
+            <value>eu.etaxonomy.cdm.model.description.StateData</value>
+            <value>eu.etaxonomy.cdm.model.description.StatisticalMeasure</value>
+            <value>eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue</value>
+            <value>eu.etaxonomy.cdm.model.description.TaxonInteraction</value>
+            <value>eu.etaxonomy.cdm.model.description.TextData</value>
+            <value>eu.etaxonomy.cdm.model.description.TextFormat</value>
+            <value>eu.etaxonomy.cdm.model.location.Continent</value>
+            <value>eu.etaxonomy.cdm.model.location.NamedArea</value>
+            <value>eu.etaxonomy.cdm.model.location.NamedAreaLevel</value>
+            <value>eu.etaxonomy.cdm.model.location.NamedAreaType</value>
+            <value>eu.etaxonomy.cdm.model.location.Point</value>
+            <value>eu.etaxonomy.cdm.model.location.ReferenceSystem</value>
+            <value>eu.etaxonomy.cdm.model.location.WaterbodyOrCountry</value>
+            <value>eu.etaxonomy.cdm.model.molecular.DnaSample</value>
+            <value>eu.etaxonomy.cdm.model.molecular.GenBankAccession</value>
+            <value>eu.etaxonomy.cdm.model.molecular.Locus</value>
+            <value>eu.etaxonomy.cdm.model.molecular.PhylogeneticTree</value>
+            <value>eu.etaxonomy.cdm.model.molecular.Sequence</value>
+            <value>eu.etaxonomy.cdm.model.molecular.TissueSample</value>
+            <value>eu.etaxonomy.cdm.model.name.BacterialName</value>
+            <value>eu.etaxonomy.cdm.model.name.BotanicalName</value>
+            <value>eu.etaxonomy.cdm.model.name.CultivarPlantName</value>
+            <value>eu.etaxonomy.cdm.model.name.HybridRelationship</value>
+            <value>eu.etaxonomy.cdm.model.name.HybridRelationshipType</value>
+            <value>eu.etaxonomy.cdm.model.name.TypeDesignationBase</value>
+            <value>eu.etaxonomy.cdm.model.name.NameRelationship</value>
+            <value>eu.etaxonomy.cdm.model.name.NameRelationshipType</value>
+            <value>eu.etaxonomy.cdm.model.name.NameTypeDesignation</value>
+            <value>eu.etaxonomy.cdm.model.name.NomenclaturalStatus</value>
+            <value>eu.etaxonomy.cdm.model.name.NomenclaturalStatusType</value>
+            <value>eu.etaxonomy.cdm.model.name.NonViralName</value>
+            <value>eu.etaxonomy.cdm.model.name.Rank</value>
+            <value>eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation</value>
+            <value>eu.etaxonomy.cdm.model.name.TaxonNameBase</value>
+            <value>eu.etaxonomy.cdm.model.name.TypeDesignationStatus</value>
+            <value>eu.etaxonomy.cdm.model.name.ViralName</value>
+            <value>eu.etaxonomy.cdm.model.name.ZoologicalName</value>
+            <value>eu.etaxonomy.cdm.model.occurrence.Collection</value>
+            <value>eu.etaxonomy.cdm.model.occurrence.Determination</value>
+            <value>eu.etaxonomy.cdm.model.occurrence.Fossil</value>
+            <value>eu.etaxonomy.cdm.model.occurrence.LivingIndividual</value>
+            <value>eu.etaxonomy.cdm.model.occurrence.Observation</value>
+            <value>eu.etaxonomy.cdm.model.occurrence.ObservationalUnit</value>
+            <value>eu.etaxonomy.cdm.model.occurrence.Occurrence</value>
+            <value>eu.etaxonomy.cdm.model.occurrence.PreservationMethod</value>
+            <value>eu.etaxonomy.cdm.model.occurrence.Specimen</value>
+            <value>eu.etaxonomy.cdm.model.reference.Article</value>
+            <value>eu.etaxonomy.cdm.model.reference.BibtexEntryType</value>
+            <value>eu.etaxonomy.cdm.model.reference.BibtexReference</value>
+            <value>eu.etaxonomy.cdm.model.reference.Book</value>
+            <value>eu.etaxonomy.cdm.model.reference.BookSection</value>
+            <value>eu.etaxonomy.cdm.model.reference.CdDvd</value>
+            <value>eu.etaxonomy.cdm.model.reference.ConferenceProceedings</value>
+            <value>eu.etaxonomy.cdm.model.reference.Database</value>
+            <value>eu.etaxonomy.cdm.model.reference.Generic</value>
+            <value>eu.etaxonomy.cdm.model.reference.INomenclaturalReference</value>
+            <value>eu.etaxonomy.cdm.model.reference.InProceedings</value>
+            <value>eu.etaxonomy.cdm.model.reference.Journal</value>
+            <value>eu.etaxonomy.cdm.model.reference.Map</value>
+            <value>eu.etaxonomy.cdm.model.reference.Patent</value>
+            <value>eu.etaxonomy.cdm.model.reference.PersonalCommunication</value>
+            <value>eu.etaxonomy.cdm.model.reference.PrintedUnitBase</value>
+            <value>eu.etaxonomy.cdm.model.reference.PrintSeries</value>
+            <value>eu.etaxonomy.cdm.model.reference.Proceedings</value>
+            <value>eu.etaxonomy.cdm.model.reference.PublicationBase</value>
+            <value>eu.etaxonomy.cdm.model.reference.ReferenceBase</value>
+            <value>eu.etaxonomy.cdm.model.reference.Report</value>
+            <value>eu.etaxonomy.cdm.model.reference.SectionBase</value>
+            <value>eu.etaxonomy.cdm.model.reference.StrictReferenceBase</value>
+            <value>eu.etaxonomy.cdm.model.reference.Thesis</value>
+            <value>eu.etaxonomy.cdm.model.reference.WebPage</value>
+            <value>eu.etaxonomy.cdm.model.taxon.ConceptRelationshipType</value>
+            <value>eu.etaxonomy.cdm.model.taxon.Synonym</value>
+            <value>eu.etaxonomy.cdm.model.taxon.SynonymRelationship</value>
+            <value>eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType</value>
+            <value>eu.etaxonomy.cdm.model.taxon.Taxon</value>
+            <value>eu.etaxonomy.cdm.model.taxon.TaxonBase</value>
+            <value>eu.etaxonomy.cdm.model.taxon.TaxonRelationship</value>
+            <value>eu.etaxonomy.cdm.model.view.View</value>
+        </list>
+    </property>
+    <property name="hibernateProperties">
+        <props>
+            <prop key="hibernate.hbm2ddl.auto">create</prop>
+            <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
+            <!--                <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
+            -->                <prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
+            <prop key="hibernate.show_sql">true</prop>
+            <prop key="hibernate.format_sql">false</prop>
+        </props>
+    </property>
+</bean>
+
+    </beans>
diff --git a/musiclib-hibernatetest/src/site/site.xml b/musiclib-hibernatetest/src/site/site.xml
new file mode 100644
index 0000000000..5521ea8dc6
--- /dev/null
+++ b/musiclib-hibernatetest/src/site/site.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project name="cdmLibrary">
+  <bannerLeft>
+    <name>CdmLibrary</name>
+    <src>http://www.e-taxonomy.eu/_styles/images/logo_edit.png</src>
+    <href>http://eu.e-taxonomy.cdm/</href>
+  </bannerLeft>
+  <bannerRight>
+    <src>http://www.e-taxonomy.eu/_styles/images/logo_edit.png</src>
+  </bannerRight>
+ <!-- <skin>
+  	<groupId>org.apache.maven.skins</groupId>
+  	<artifactId>maven-stylus-skin</artifactId>
+  	<version>1.0.1</version>
+  </skin>  -->
+  <skin>
+  	<groupId>org.apache.maven.skins</groupId>
+<!--<artifactId>maven-stylus-skin</artifactId>
+  	<version>1.0.1</version>
+  	<artifactId>maven-default-skin</artifactId>
+  	<version>1.0</version>
+-->	<artifactId>maven-classic-skin</artifactId>
+  	<version>1.0</version>
+  </skin>
+  
+  <publishDate format="dd-MM-yyyy"/>  
+  <body>
+    <links>
+      <item name="Edit" href="http://www.e-taxonomy.eu/" />
+      <item name="WP5" href="http://wp5.e-taxonomy.eu/blog/index.php"/>
+    </links>
+
+    <menu name="CdmLibrary">
+      <item name="Introduction" href="index.html"/>
+      <item name="Download" href="source-repository.html"/>
+     </menu>
+     <menu name="TestMenu">
+     	<item name="TestItem"/>
+     </menu>
+	${reports}
+  </body>
+</project>
\ No newline at end of file
