pom.xml | 23 ++++++++++++++--- poulpe-model/pom.xml | 5 +++- .../model/dao/hibernate/UserHibernateDao.java | 10 ++++---- poulpe-model/src/main/resources/log4j.xml | 4 +++ .../jtalks/poulpe/migrations/V1__Base_version.sql | 2 +- .../org/jtalks/poulpe/model/datasource.properties | 2 +- .../org/jtalks/poulpe/model/entity/Branch.hbm.xml | 17 ++++++++++--- .../org/jtalks/poulpe/model/entity/Section.hbm.xml | 14 +++++++++- .../org/jtalks/poulpe/model/entity/User.hbm.xml | 26 ++++++++++++------- .../org/jtalks/poulpe/model/entity/ehcache.xml | 24 ++++++++++++++++++ .../org/jtalks/poulpe/model/entity/jgroups_tcp.xml | 26 -------------------- 11 files changed, 99 insertions(+), 54 deletions(-) diff --git a/pom.xml b/pom.xml index 1d5357c..694da30 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,10 @@ ZK CE http://mavensync.zkoss.org/maven2 + + terracotta-releases + http://www.terracotta.org/download/reflector/releases + @@ -73,13 +77,24 @@ net.sf.ehcache ehcache-core - 2.4.0 + 2.4.3 net.sf.ehcache ehcache-jgroupsreplication 1.5 + + org.terracotta + ehcache-probe + 1.0.2 + + + org.slf4j + slf4j-jdk14 + + + @@ -102,12 +117,12 @@ org.slf4j slf4j-api - 1.6.1 + 1.5.8 org.slf4j slf4j-log4j12 - 1.6.1 + 1.5.8 @@ -457,7 +472,7 @@ 3.0.5.RELEASE 6.0.1.FL.20120413 UTF-8 - 0.14 + 0.14-SNAPSHOT diff --git a/poulpe-model/pom.xml b/poulpe-model/pom.xml index a054302..de87b91 100644 --- a/poulpe-model/pom.xml +++ b/poulpe-model/pom.xml @@ -126,7 +126,10 @@ net.sf.ehcache ehcache-jgroupsreplication - + + org.terracotta + ehcache-probe + diff --git a/poulpe-model/src/main/java/org/jtalks/poulpe/model/dao/hibernate/UserHibernateDao.java b/poulpe-model/src/main/java/org/jtalks/poulpe/model/dao/hibernate/UserHibernateDao.java index 29131a9..800995f 100644 --- a/poulpe-model/src/main/java/org/jtalks/poulpe/model/dao/hibernate/UserHibernateDao.java +++ b/poulpe-model/src/main/java/org/jtalks/poulpe/model/dao/hibernate/UserHibernateDao.java @@ -39,7 +39,7 @@ public class UserHibernateDao extends AbstractHibernateParentRepository im */ @Override public User getPoulpeUserByUsername(String username) { - return (User) getSession().createQuery("from " + type.getSimpleName() + " u where u.username = ?") + return (User) getSession().createQuery("from " + type.getCanonicalName() + " u where u.username = ?") .setString(0, username).uniqueResult(); } @@ -48,7 +48,7 @@ public class UserHibernateDao extends AbstractHibernateParentRepository im */ @Override public User getPoulpeUserByEncodedUsername(String encodedUsername) { - return (User) getSession().createQuery("from " + type.getSimpleName() + " u where u.encodedUsername = ?") + return (User) getSession().createQuery("from " + type.getCanonicalName() + " u where u.encodedUsername = ?") .setCacheable(true).setString(0, encodedUsername).uniqueResult(); } @@ -58,7 +58,7 @@ public class UserHibernateDao extends AbstractHibernateParentRepository im @SuppressWarnings("unchecked") @Override public List getAllPoulpeUsers() { - return (List) getSession().createQuery("from " + type.getSimpleName()).list(); + return (List) getSession().createQuery("from " + type.getCanonicalName()).list(); } /** @@ -68,7 +68,7 @@ public class UserHibernateDao extends AbstractHibernateParentRepository im @Override public List getPoulpeUserByUsernamePart(String substring) { String param = MessageFormat.format("%{0}%", substring); - return (List) getSession().createQuery("from " + type.getSimpleName() + " u where u.username like ?") + return (List) getSession().createQuery("from " + type.getCanonicalName() + " u where u.username like ?") .setString(0, param).list(); } @@ -93,7 +93,7 @@ public class UserHibernateDao extends AbstractHibernateParentRepository im @Override public List getNonBannedByUsername(String word, int maxResults) { return (List) getSession() - .createQuery("from " + type.getSimpleName() + " u where u.banReason is null and u.username like ?") + .createQuery("from " + type.getCanonicalName() + " u where u.banReason is null and u.username like ?") .setString(0, MessageFormat.format("%{0}%", word)).setMaxResults(maxResults).list(); } diff --git a/poulpe-model/src/main/resources/log4j.xml b/poulpe-model/src/main/resources/log4j.xml index 94f4786..4d42b54 100644 --- a/poulpe-model/src/main/resources/log4j.xml +++ b/poulpe-model/src/main/resources/log4j.xml @@ -40,6 +40,10 @@ + + + + diff --git a/poulpe-model/src/main/resources/org/jtalks/poulpe/migrations/V1__Base_version.sql b/poulpe-model/src/main/resources/org/jtalks/poulpe/migrations/V1__Base_version.sql index e50f5ce..d964b50 100644 --- a/poulpe-model/src/main/resources/org/jtalks/poulpe/migrations/V1__Base_version.sql +++ b/poulpe-model/src/main/resources/org/jtalks/poulpe/migrations/V1__Base_version.sql @@ -24,7 +24,7 @@ CREATE TABLE `BRANCH_USER_REF` ( CONSTRAINT `FK_BRANCH_USER_REF_USERS_USER_ID` FOREIGN KEY (`USER_ID`) REFERENCES `USERS` (`ID`), - CONSTRAINT `FK_BRANCH` + CONSTRAINT `FK_BRANCH_USER_REF_BRACHES_BRANCH_ID` FOREIGN KEY (`BRANCH_ID`) REFERENCES `BRANCHES` (`BRANCH_ID`)); diff --git a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/datasource.properties b/poulpe-model/src/main/resources/org/jtalks/poulpe/model/datasource.properties index 74d74a6..c2fa8c8 100644 --- a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/datasource.properties +++ b/poulpe-model/src/main/resources/org/jtalks/poulpe/model/datasource.properties @@ -14,7 +14,7 @@ # jdbc.driverClassName=com.mysql.jdbc.Driver -jdbc.url=jdbc:mysql://localhost/p_poulpe?characterEncoding=UTF-8 +jdbc.url=jdbc:mysql://localhost/jtalks?characterEncoding=UTF-8 jdbc.username=${jdbc.user} jdbc.password=${jdbc.pass} hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect diff --git a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/Branch.hbm.xml b/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/Branch.hbm.xml index 5b7ee2b..d35e0a9 100644 --- a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/Branch.hbm.xml +++ b/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/Branch.hbm.xml @@ -18,11 +18,16 @@ - - + + + + + 'BRANCH' + + @@ -30,7 +35,11 @@ - + + + diff --git a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/Section.hbm.xml b/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/Section.hbm.xml index c3a489f..8493699 100644 --- a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/Section.hbm.xml +++ b/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/Section.hbm.xml @@ -18,11 +18,16 @@ - - + + + + + 'SECTION' + + @@ -33,6 +38,11 @@ + + + diff --git a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/User.hbm.xml b/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/User.hbm.xml index 8b3c8a2..c0c151d 100644 --- a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/User.hbm.xml +++ b/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/User.hbm.xml @@ -17,14 +17,18 @@ --> - - - + + + + + 'USER' + + @@ -48,13 +52,15 @@ - - - - - - - + + + + + + + + + diff --git a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/ehcache.xml b/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/ehcache.xml index 5cea532..7fb045c 100644 --- a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/ehcache.xml +++ b/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/ehcache.xml @@ -16,6 +16,21 @@ --> + + + + + + + + @@ -25,4 +40,13 @@ + + + + + \ No newline at end of file diff --git a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/jgroups_tcp.xml b/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/jgroups_tcp.xml deleted file mode 100644 index 2c6d14e..0000000 --- a/poulpe-model/src/main/resources/org/jtalks/poulpe/model/entity/jgroups_tcp.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - \ No newline at end of file