[lambico] 3 new revisions pushed by lucio.be...@gmail.com on 2015-02-27 23:18 GMT

3 views
Skip to first unread message

lam...@googlecode.com

unread,
Feb 27, 2015, 6:18:37 PM2/27/15
to lambico...@googlegroups.com
3 new revisions:

Revision: e7ee8838f887
Branch: v4.0
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Fri Feb 27 07:29:33 2015 UTC
Log: Start v4.0 branch
https://code.google.com/p/lambico/source/detail?r=e7ee8838f887

Revision: e76474521f2d
Branch: v4.0
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Fri Feb 27 07:43:36 2015 UTC
Log: Updated lambico version to 4.0, syncroninzing the major version
with t...
https://code.google.com/p/lambico/source/detail?r=e76474521f2d

Revision: bc1aa3ae5194
Branch: v4.0
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Fri Feb 27 23:14:01 2015 UTC
Log: Updated Hibernate and Spring to version 4.
https://code.google.com/p/lambico/source/detail?r=bc1aa3ae5194

==============================================================================
Revision: e7ee8838f887
Branch: v4.0
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Fri Feb 27 07:29:33 2015 UTC
Log: Start v4.0 branch
https://code.google.com/p/lambico/source/detail?r=e7ee8838f887



==============================================================================
Revision: e76474521f2d
Branch: v4.0
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Fri Feb 27 07:43:36 2015 UTC
Log: Updated lambico version to 4.0, syncroninzing the major version
with the target Hibernate major version from now.
https://code.google.com/p/lambico/source/detail?r=e76474521f2d

Modified:
/lambico-core/pom.xml
/lambico-pump/pom.xml
/lambico-spring-hibernate/pom.xml
/lambico-spring/pom.xml
/lambico-test/pom.xml
/pom.xml

=======================================
--- /lambico-core/pom.xml Thu Feb 28 17:37:27 2013 UTC
+++ /lambico-core/pom.xml Fri Feb 27 07:43:36 2015 UTC
@@ -3,7 +3,7 @@
<parent>
<artifactId>lambico</artifactId>
<groupId>org.lambico</groupId>
- <version>1.1-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.lambico</groupId>
@@ -11,7 +11,7 @@
<packaging>jar</packaging>
<name>Lambico Core</name>
<description>Base general components of Lambico.</description>
- <version>1.1-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
<properties>
<main.basedir>${basedir}/..</main.basedir>
</properties>
=======================================
--- /lambico-pump/pom.xml Fri Mar 8 16:54:32 2013 UTC
+++ /lambico-pump/pom.xml Fri Feb 27 07:43:36 2015 UTC
@@ -4,14 +4,14 @@
<parent>
<artifactId>lambico</artifactId>
<groupId>org.lambico</groupId>
- <version>1.1-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
</parent>
<groupId>org.lambico</groupId>
<artifactId>lambico-pump</artifactId>
<packaging>jar</packaging>
<name>Lambico Data Pump</name>
<description>Lambico's support for data loading.</description>
- <version>1.1-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
<url>http://www.lambico.org</url>
<inceptionYear>2013</inceptionYear>
<properties>
=======================================
--- /lambico-spring-hibernate/pom.xml Wed Mar 13 17:53:54 2013 UTC
+++ /lambico-spring-hibernate/pom.xml Fri Feb 27 07:43:36 2015 UTC
@@ -4,12 +4,12 @@
<parent>
<artifactId>lambico</artifactId>
<groupId>org.lambico</groupId>
- <version>1.1-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
</parent>
<groupId>org.lambico</groupId>
<artifactId>lambico-spring-hibernate</artifactId>
<packaging>jar</packaging>
- <version>1.1-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
<name>Lambico Spring - Hibernate</name>
<description>Lambico implementation based on the Spring framework,
with Hibernate.</description>
<properties>
=======================================
--- /lambico-spring/pom.xml Wed Mar 13 17:53:54 2013 UTC
+++ /lambico-spring/pom.xml Fri Feb 27 07:43:36 2015 UTC
@@ -4,12 +4,12 @@
<parent>
<artifactId>lambico</artifactId>
<groupId>org.lambico</groupId>
- <version>1.1-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
</parent>
<groupId>org.lambico</groupId>
<artifactId>lambico-spring</artifactId>
<packaging>jar</packaging>
- <version>1.1-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
<name>Lambico Spring</name>
<description>Lambico implementation based on the Spring
framework.</description>
<properties>
=======================================
--- /lambico-test/pom.xml Fri Feb 22 12:45:46 2013 UTC
+++ /lambico-test/pom.xml Fri Feb 27 07:43:36 2015 UTC
@@ -4,12 +4,12 @@
<parent>
<artifactId>lambico</artifactId>
<groupId>org.lambico</groupId>
- <version>1.1-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
</parent>
<groupId>org.lambico</groupId>
<artifactId>lambico-test</artifactId>
<packaging>jar</packaging>
- <version>1.1-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
<name>Lambico Test</name>
<description>Lambico's support for unit testing.</description>
<properties>
=======================================
--- /pom.xml Thu Mar 14 07:46:23 2013 UTC
+++ /pom.xml Fri Feb 27 07:43:36 2015 UTC
@@ -4,7 +4,7 @@
<groupId>org.lambico</groupId>
<artifactId>lambico</artifactId>
<packaging>pom</packaging>
- <version>1.1-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
<name>Lambico</name>
<description>Lambico provides a generic DAO infrastructure to your
applications.</description>
<url>http://www.lambico.org</url>

==============================================================================
Revision: bc1aa3ae5194
Branch: v4.0
Author: lucio.benfante <lucio.b...@gmail.com>
Date: Fri Feb 27 23:14:01 2015 UTC
Log: Updated Hibernate and Spring to version 4.
https://code.google.com/p/lambico/source/detail?r=bc1aa3ae5194

Added:
/lambico-spring-hibernate/src/test/resources/applicationContext-test.xml
/lambico-test/src/main/java/org/lambico/test/ExtraAssert.java
Deleted:
/lambico-spring-hibernate/src/test/resources/applicationContext_test.xml
/lambico-test/src/main/java/org/lambico/test/spring/EnhancedTestCase.java
/lambico-test/src/main/java/org/lambico/test/spring/hibernate/DBTest.java
Modified:
/lambico-core/pom.xml
/lambico-core/src/assembly/bin-with-dependencies.xml
/lambico-core/src/assembly/bin.xml
/lambico-core/src/main/java/org/lambico/dao/BypassingExceptionManager.java
/lambico-core/src/main/java/org/lambico/dao/DaoExceptionManager.java
/lambico-core/src/main/java/org/lambico/dao/DaoExceptionManagerBase.java
/lambico-core/src/main/java/org/lambico/dao/LoggingExceptionManager.java
/lambico-core/src/main/java/org/lambico/dao/generic/CacheIt.java
/lambico-core/src/main/java/org/lambico/dao/generic/Compare.java
/lambico-core/src/main/java/org/lambico/dao/generic/CompareType.java
/lambico-core/src/main/java/org/lambico/dao/generic/Dao.java
/lambico-core/src/main/java/org/lambico/dao/generic/FirstResult.java

/lambico-core/src/main/java/org/lambico/dao/generic/GenericDaoTypeSupport.java
/lambico-core/src/main/java/org/lambico/dao/generic/MaxResults.java
/lambico-core/src/main/java/org/lambico/dao/generic/Page.java
/lambico-core/src/main/java/org/lambico/dao/generic/package-info.java
/lambico-core/src/main/java/org/lambico/dao/hibernate/package-info.java
/lambico-core/src/main/java/org/lambico/dao/package-info.java
/lambico-core/src/main/java/org/lambico/dao/spring/BusinessDao.java

/lambico-core/src/main/java/org/lambico/dao/spring/hibernate/GenericDaoHibernateSupport.java

/lambico-core/src/main/java/org/lambico/dao/spring/hibernate/package-info.java
/lambico-core/src/main/java/org/lambico/dao/spring/package-info.java
/lambico-core/src/main/java/org/lambico/po/hibernate/package-info.java
/lambico-core/src/main/java/org/lambico/util/package-info.java

/lambico-core/src/test/java/org/lambico/dao/generic/PageDefaultImplTest.java
/lambico-core/src/test/java/org/lambico/po/hibernate/EntityBaseTest.java
/lambico-spring-hibernate/pom.xml
/lambico-spring-hibernate/src/main/assembly/library-assembly.xml

/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateDaoBeanCreator.java

/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateDaoInstrumentation.java

/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateDaoUtils.java

/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateGenericBusinessDao.java

/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateGenericDaoImpl.java

/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/package-info.java

/lambico-spring-hibernate/src/main/resources/org/lambico/spring/dao/hibernate/applicationContextBase.xml

/lambico-spring-hibernate/src/main/resources/org/lambico/spring/dao/hibernate/genericDao.xml

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/BaseTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/CachedEntityTCTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/DaoProviderTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCBisTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCNoInheritanceTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCTerTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCWithoutDaoInterfaceTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/HibernateDaoBeanCreatorTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/HibernateDaoUtilsTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/HibernateGenericBusinessDaoTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/HibernateGenericDaoTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/ManyToManyFixturesTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/VersionedEntityTest.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/bo/EntityTCBO.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/bo/EntityTCBusinessDao.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/bo/EntityTCTerBusinessDao.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/bo/VersionedEntityTCBO.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/dao/CachedEntityTCDao.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/dao/EntityTCDao.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/dao/TestDaos.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/dao/VersionedEntityTCDao.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/daobis/EntityTCBisDao.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/daoter/EntityTCTerDao.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/po/CachedEntityTC.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/po/EntityTC.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/po/EntityTCNoInheritance.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/po/EntityTCWithoutDaoInterface.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/po/VersionedEntityDataTC.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/po/VersionedEntityTC.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/pobis/EntityTCBis.java

/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/poter/EntityTCTer.java
/lambico-spring/pom.xml
/lambico-spring/src/main/java/org/lambico/spring/dao/DaoUtils.java
/lambico-spring/src/main/java/org/lambico/spring/dao/package-info.java
/lambico-spring/src/main/java/org/lambico/spring/xml/ContextUtils.java
/lambico-spring/src/main/java/org/lambico/spring/xml/DaoBeanCreator.java
/lambico-spring/src/main/java/org/lambico/spring/xml/EntityDiscoverer.java
/lambico-spring/src/main/java/org/lambico/spring/xml/package-info.java
/lambico-spring/src/main/resources/org/lambico/spring/xml/lambico.xsd
/lambico-spring/src/test/java/org/lambico/spring/xml/test/FakeEntity.java
/lambico-test/pom.xml

/lambico-test/src/main/java/org/lambico/test/spring/hibernate/FixtureUtils.java

/lambico-test/src/main/java/org/lambico/test/spring/hibernate/junit4/FixturesConfigurationAttributes.java

/lambico-test/src/main/java/org/lambico/test/spring/hibernate/junit4/FixturesTestExecutionListener.java

/lambico-test/src/main/java/org/lambico/test/spring/hibernate/package-info.java
/lambico-test/src/main/java/org/lambico/test/spring/package-info.java
/lambico_checks.xml
/pom.xml
/src/site/site.xml

=======================================
--- /dev/null
+++
/lambico-spring-hibernate/src/test/resources/applicationContext-test.xml
Fri Feb 27 23:14:01 2015 UTC
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 Lambico Team <lucio.b...@gmail.com>
+
+ This file is part of Lambico Spring - Hibernate.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xmlns:lambico="http://www.lambico.org/schema/lambico"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
+ http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
+ http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd
+ http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-4.0.xsd">
+
+ <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:mem:lambico"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </bean>
+
+ <bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
parent="abstractSessionFactory">
+ <property name="hibernateProperties">
+ <props>
+ <!--prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop-->
+ <prop key="hibernate.hbm2ddl.auto">update</prop>
+ <prop key="hibernate.show_sql">false</prop>
+ <prop key="hibernate.cache.use_query_cache">true</prop>
+ <prop
key="hibernate.cache.use_second_level_cache">true</prop>
+ <prop
key="hibernate.cache.region.factory_class">org.hibernate.testing.cache.CachingRegionFactory</prop>
+ <prop key="hibernate.generate_statistics">true</prop>
+ </props>
+ </property>
+ </bean>
+
+ <context:component-scan
base-package="org.lambico.spring.dao.hibernate.bo"/>
+ <!-- Authomatic detection of persistent classes -->
+ <lambico:discover-persistent-classes
basePackage="org.lambico.spring.dao.hibernate.po" />
+ <lambico:discover-persistent-classes
basePackage="org.lambico.spring.dao.hibernate.pobis" />
+ <lambico:discover-persistent-classes
basePackage="org.lambico.spring.dao.hibernate.poter" />
+ <!-- Authomatic DAO definition from persistent classes -->
+ <lambico:define-daos
baseInterfacePackage="org.lambico.spring.dao.hibernate.dao"
+
baseEntityPackage="org.lambico.spring.dao.hibernate.po"/>
+ <lambico:define-daos
baseInterfacePackage="org.lambico.spring.dao.hibernate.daobis"
+
baseEntityPackage="org.lambico.spring.dao.hibernate.pobis"/>
+ <lambico:define-daos
baseInterfacePackage="org.lambico.spring.dao.hibernate.daoter"
+
baseEntityPackage="org.lambico.spring.dao.hibernate.poter"/>
+
+ <bean id="entityTCTerDao"
class="org.lambico.spring.dao.hibernate.bo.EntityTCTerBusinessDao" />
+
+ <bean id="daos" parent="abstractDaoProvider">
+ <property name="proxyInterfaces">
+ <value>org.lambico.spring.dao.hibernate.dao.TestDaos</value>
+ </property>
+ <property name="target">
+ <bean parent="genericDaoProvider"/>
+ </property>
+ </bean>
+
+ <util:map id="daoMap">
+ <entry key="entityTCDao" value-ref="entityTCDao"/>
+ </util:map>
+
+ <bean id="daoExceptionManager"
class="org.lambico.dao.BypassingExceptionManager"/>
+</beans>
=======================================
--- /dev/null
+++ /lambico-test/src/main/java/org/lambico/test/ExtraAssert.java Fri Feb
27 23:14:01 2015 UTC
@@ -0,0 +1,56 @@
+/**
+ * Copyright (C) 2009 Lambico Team <lucio.b...@gmail.com>
+ *
+ * This file is part of Lambico Test.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.lambico.test;
+
+import java.util.Collection;
+import static org.junit.Assert.*;
+
+/**
+ * A set of assertion methods useful for writing tests.
+ *
+ * @author Lucio Benfante
+ * @since 4.0
+ */
+public class ExtraAssert {
+
+ protected ExtraAssert() {
+ }
+
+ /**
+ * Assers that a collection is not empty. It fails if the collection
is null.
+ *
+ * @param c the collection
+ */
+ static public void assertNotEmpty(Collection c) {
+ assertNotNull(c);
+ assertNotEquals(0, c.size());
+ }
+
+ /**
+ * Asserts that a collection contains the expected number of elements.
It fails if the collection
+ * is null.
+ *
+ * @param expected expected value
+ * @param c the collection
+ */
+ static public void assertSize(int expected, Collection c) {
+ assertNotNull(c);
+ assertEquals(expected, c.size());
+ }
+
+}
=======================================
---
/lambico-spring-hibernate/src/test/resources/applicationContext_test.xml
Sun Mar 6 09:19:55 2011 UTC
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009 Lambico Team <lucio.b...@gmail.com>
-
- This file is part of Lambico Spring - Hibernate.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:lambico="http://www.lambico.org/schema/lambico"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
- http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.lambico.org/schema/lambico
http://www.lambico.org/schema/lambico.xsd">
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:mem:lambico"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </bean>
-
- <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
parent="abstractSessionFactory">
- <property name="hibernateProperties">
- <props>
- <!--prop
key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop-->
- <prop key="hibernate.hbm2ddl.auto">update</prop>
- <prop key="hibernate.show_sql">false</prop>
- <prop key="hibernate.cache.use_query_cache">true</prop>
- <prop
key="hibernate.cache.use_second_level_cache">true</prop>
- <prop
key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
- <prop key="hibernate.generate_statistics">true</prop>
- </props>
- </property>
- </bean>
-
- <context:component-scan
base-package="org.lambico.spring.dao.hibernate.bo"/>
- <!-- Authomatic detection of persistent classes -->
- <lambico:discover-persistent-classes
basePackage="org.lambico.spring.dao.hibernate.po" />
- <lambico:discover-persistent-classes
basePackage="org.lambico.spring.dao.hibernate.pobis" />
- <lambico:discover-persistent-classes
basePackage="org.lambico.spring.dao.hibernate.poter" />
- <!-- Authomatic DAO definition from persistent classes -->
- <lambico:define-daos
baseInterfacePackage="org.lambico.spring.dao.hibernate.dao"
-
baseEntityPackage="org.lambico.spring.dao.hibernate.po"/>
- <lambico:define-daos
baseInterfacePackage="org.lambico.spring.dao.hibernate.daobis"
-
baseEntityPackage="org.lambico.spring.dao.hibernate.pobis"/>
- <lambico:define-daos
baseInterfacePackage="org.lambico.spring.dao.hibernate.daoter"
-
baseEntityPackage="org.lambico.spring.dao.hibernate.poter"/>
-
- <bean id="entityTCTerDao"
class="org.lambico.spring.dao.hibernate.bo.EntityTCTerBusinessDao" />
-
- <bean id="daos" parent="abstractDaoProvider">
- <property name="proxyInterfaces">
- <value>org.lambico.spring.dao.hibernate.dao.TestDaos</value>
- </property>
- <property name="target">
- <bean parent="genericDaoProvider"/>
- </property>
- </bean>
-
- <bean id="daoExceptionManager"
class="org.lambico.dao.BypassingExceptionManager"/>
-</beans>
=======================================
---
/lambico-test/src/main/java/org/lambico/test/spring/EnhancedTestCase.java
Sun Feb 24 15:24:09 2013 UTC
+++ /dev/null
@@ -1,151 +0,0 @@
-/**
- * Copyright (C) 2009 Lambico Team <lucio.b...@gmail.com>
- *
- * This file is part of Lambico Test.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.lambico.test.spring;
-
-import java.util.Collection;
-import org.lambico.test.spring.hibernate.junit4.AbstractBaseTest;
-import
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests;
-
-/**
- * Adds useful assertions to the standard JUnit TestCase.
- *
- * @deprecated please use hamcrest.
- * @see AbstractBaseTest
- * @see org.hamcrest.CoreMatchers
- * @see org.hamcrest.MatcherAssert
- */
-@Deprecated
-public abstract class EnhancedTestCase extends
AbstractAnnotationAwareTransactionalTests {
-
- /**
- * Assert equality between two arrays of bytes.
- *
- * @param expected The expected array.
- * @param actual The inspected array.
- */
- public static void assertEquals(final byte[] expected, final byte[]
actual) {
- assertEquals("", expected, actual);
- }
-
- /**
- * Assert equality between two arrays of bytes.
- *
- * @param description The message in case of inequality.
- * @param expected The expected array.
- * @param actual The inspected array.
- */
- public static void assertEquals(final String description, final byte[]
expected,
- final byte[] actual) {
- for (int i = 0; i < expected.length; i++) {
- assertEquals(description + ": byte[" + i + "] does not match",
expected[i], actual[i]);
- }
- }
-
- /**
- * Assert equality between two arrays of doubles.
- *
- * @param expected The expected array.
- * @param actual The inspected array.
- */
- public static void assertEquals(final double[] expected, final
double[] actual) {
- assertEquals("", expected, actual);
- }
-
- /**
- * Assert equality between two arrays of doubles.
- *
- * @param description The message in case of inequality.
- * @param expected The expected array.
- * @param actual The inspected array.
- */
- public static void assertEquals(final String description, final
double[] expected,
- final double[] actual) {
- for (int i = 0; i < expected.length; i++) {
- assertEquals(description + ": double[" + i + "] does not
match",
- expected[i], actual[i]);
- }
- }
-
- /**
- * Assert equality of two strings, ignoring the case.
- *
- * @param expected The expected string.
- * @param actual The inspected string.
- */
- public static void assertEqualsIgnoreCase(final String expected, final
String actual) {
- assertEquals(expected.toLowerCase(), actual.toLowerCase());
- }
-
- /**
- * Assert the emptyness of a Collection.
- *
- * @param c The collection to inspect.
- */
- public static void assertEmpty(final Collection c) {
- assertSize(0, c);
- }
-
- /**
- * Assert the not emptyness of a Collection.
- *
- * @param message The message in case the collection is empty.
- * @param c The collection to inspect.
- */
- public static void assertNotEmpty(final String message, final
Collection c) {
- assertTrue(message, c.size() > 0);
- }
-
- /**
- * Assert the not emptyness of a Collection.
- *
- * @param c The collection to inspect.
- */
- public static void assertNotEmpty(final Collection c) {
- assertTrue(c.size() > 0);
- }
-
- /**
- * Assert the not emptyness of an array of Objects.
- *
- * @param message The message in case the array is empty.
- * @param array The collection to inspect.
- */
- public static void assertNotEmpty(final String message, final Object[]
array) {
- assertTrue(message, array.length > 0);
- }
-
- /**
- * Assert the not emptyness of an array of Objects.
- *
- * @param array The collection to inspect.
- */
- public static void assertNotEmpty(final Object[] array) {
- assertTrue(array.length > 0);
- }
-
- /**
- * Assert the size of a Collection.
- *
- * @param size The expected size.
- * @param c The Collection to inspect.
- */
- public static void assertSize(final int size, final Collection c) {
- assertTrue("Size of the collection: expected " + size + ", got "
- + c.size(), c.size() == size);
- }
-}
=======================================
---
/lambico-test/src/main/java/org/lambico/test/spring/hibernate/DBTest.java
Wed Feb 27 16:43:09 2013 UTC
+++ /dev/null
@@ -1,180 +0,0 @@
-/**
- * Copyright (C) 2009 Lambico Team <lucio.b...@gmail.com>
- *
- * This file is part of Lambico Test.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.lambico.test.spring.hibernate;
-
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import javax.annotation.Resource;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.lambico.dao.generic.GenericDaoBase;
-import org.lambico.data.YamlFixtureHelper;
-import org.lambico.test.spring.EnhancedTestCase;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.ResourceLoader;
-import org.springframework.orm.hibernate3.SessionHolder;
-import
org.springframework.transaction.support.TransactionSynchronizationManager;
-
-/**
- * A base class for tests that populate the DB with the fixture data.
- *
- * @author Jacopo Murador <jacopo.murador at seesaw.it>
- *
- * @deprecated as of Spring 3.0, in favor of using the listener-based test
context framework
- * ({@link
org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests})
- * @see AbstractBaseTest
- * @see FixtureLoaderTestExecutionListener
- */
-@Deprecated
-public abstract class DBTest extends EnhancedTestCase {
-
- protected Map<Class, List> fixtures;
- @Resource
- protected SessionFactory sessionFactory;
- @Resource(name = "daoMap")
- protected HashMap daoMap;
-
- /**
- * Returns a <strong>reverse-ordered</strong> array of the models that
need to be loaded.
- *
- * @return The array of class models.
- */
- public final Class[] getReverseOrderFixtureClasses() {
- Class[] models = getFixtureClasses();
- CollectionUtils.reverseArray(models);
- return models;
- }
-
- /**
- * Returns a <strong>reverse-ordered</strong> array of the models that
need to be loaded.
- *
- * NB: It must always return a new object, not a reference to an
already existent object.
- *
- * @return The array of class models.
- */
- public Class[] getFixtureClasses() {
- return new Class[]{};
- }
-
- /**
- * Returns a set of the models that need to be loaded.
- *
- * @return The set of class models.
- */
- public final Set<Class> getFixtureClassSet() {
- Class[] classes = getFixtureClasses();
- Set<Class> result = new LinkedHashSet<Class>(classes.length);
- CollectionUtils.addAll(result, classes);
- return result;
- }
-
- /**
- * Delete the rows from the tables, and reinsert all data.
- *
- * @throws Exception In case of error.
- */
- @Override
- public void onSetUpBeforeTransaction() throws Exception {
- Session session = sessionFactory.openSession();
- session.beginTransaction();
- //Attach transaction to thread
- TransactionSynchronizationManager.bindResource(sessionFactory, new
SessionHolder(session));
- TransactionSynchronizationManager.initSynchronization();
-
- try {
- // erase everything
- for (Class model : getReverseOrderFixtureClasses()) {
- GenericDaoBase dao = DaoUtils.getDaoFor(model,
applicationContext);
- FixtureUtils.eraseDbForModel(model, dao);
- }
- // repopulate
- for (Class model : getFixtureClasses()) {
- GenericDaoBase dao = DaoUtils.getDaoFor(model,
applicationContext);
- FixtureUtils.populateDbForModel(model,
fixtures.get(model), dao);
- }
- session.getTransaction().commit();
- } catch (Exception e) {
- logger.error(e);
- logger.debug("Rolling back the database transaction");
- session.getTransaction().rollback();
- } finally {
- try {
- session.close();
- } catch (Exception e) { /*do nothing*/
- logger.info("Can't close the session! (ignore it)");
- }
-
TransactionSynchronizationManager.unbindResource(sessionFactory);
- TransactionSynchronizationManager.clearSynchronization();
- }
-
- }
-
- @Override
- protected String[] getConfigLocations() {
- return new String[]{
- "classpath:org/lambico/spring/dao/hibernate/genericDao.xml",
- "classpath:org/lambico/spring/dao/hibernate/applicationContextBase.xml",
- "classpath:applicationContext_test.xml"
- };
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected void prepareTestInstance() throws Exception {
- super.prepareTestInstance();
- daoMap.putAll(DaoUtils.getDaos(applicationContext));
-
- if (fixtures == null) {
- // carico le fixture se non sono già presenti
- Set<Class> fixtureClasses = getFixtureClassSet();
- if (fixtureClasses != null && fixtureClasses.size() > 0) {
- try {
- fixtures = YamlFixtureHelper.loadFixturesFromResource(
- (ClassPathResource)
applicationContext.getResource(
- ResourceLoader.CLASSPATH_URL_PREFIX
+ "/fixtures/"), fixtureClasses);
- logger.info("Loaded fixtures for classes "
- + fixtures.keySet().toString());
- } catch (Exception e) {
- logger.warn("I can't load all fixture for classes "
- + fixtureClasses.toString(), e);
- }
- } else {
- logger.info("No fixtures to load");
- }
- }
- }
-
- /**
- * At the end of the test the method endTransaction call a rollback
for the transaction although
- * a explicit rollback call is did. This raise a false exception.
- */
- @Override
- protected void endTransaction() {
- try {
- super.endTransaction();
- } catch (Exception ex) {
- //do nothing
- logger.info("Expected false exception when ending transaction!
(ignore it)");
- }
- }
-}
=======================================
--- /lambico-core/pom.xml Fri Feb 27 07:43:36 2015 UTC
+++ /lambico-core/pom.xml Fri Feb 27 23:14:01 2015 UTC
@@ -22,6 +22,11 @@
<optional>true</optional>
</dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<optional>true</optional>
=======================================
--- /lambico-core/src/assembly/bin-with-dependencies.xml Thu Jan 7
17:56:19 2010 UTC
+++ /lambico-core/src/assembly/bin-with-dependencies.xml Fri Feb 27
23:14:01 2015 UTC
@@ -17,7 +17,6 @@
limitations under the License.

-->
-
<assembly>
<id>bin-with-dependencies</id>
<formats>
=======================================
--- /lambico-core/src/assembly/bin.xml Thu Jan 7 17:56:19 2010 UTC
+++ /lambico-core/src/assembly/bin.xml Fri Feb 27 23:14:01 2015 UTC
@@ -17,7 +17,6 @@
limitations under the License.

-->
-
<assembly>
<id>bin</id>
<formats>
=======================================
---
/lambico-core/src/main/java/org/lambico/dao/BypassingExceptionManager.java
Thu Feb 4 13:52:51 2010 UTC
+++
/lambico-core/src/main/java/org/lambico/dao/BypassingExceptionManager.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao;

import java.util.Properties;
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/DaoExceptionManager.java
Thu Feb 4 13:52:51 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/DaoExceptionManager.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao;

import java.util.Properties;
=======================================
---
/lambico-core/src/main/java/org/lambico/dao/DaoExceptionManagerBase.java
Thu Feb 4 13:52:51 2010 UTC
+++
/lambico-core/src/main/java/org/lambico/dao/DaoExceptionManagerBase.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao;

import java.util.Properties;
=======================================
---
/lambico-core/src/main/java/org/lambico/dao/LoggingExceptionManager.java
Thu Feb 28 17:37:27 2013 UTC
+++
/lambico-core/src/main/java/org/lambico/dao/LoggingExceptionManager.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao;

import java.util.Properties;
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/generic/CacheIt.java Mon
Jan 3 18:30:49 2011 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/generic/CacheIt.java Fri
Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao.generic;

import java.lang.annotation.Documented;
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/generic/Compare.java Thu
Jan 7 17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/generic/Compare.java Fri
Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao.generic;

import java.lang.annotation.Documented;
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/generic/CompareType.java
Thu Jan 7 17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/generic/CompareType.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao.generic;

/**
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/generic/Dao.java Thu Jan 7
17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/generic/Dao.java Fri Feb 27
23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao.generic;

import java.lang.annotation.Documented;
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/generic/FirstResult.java
Thu Jan 7 17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/generic/FirstResult.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao.generic;

import java.lang.annotation.Documented;
=======================================
---
/lambico-core/src/main/java/org/lambico/dao/generic/GenericDaoTypeSupport.java
Thu Jan 7 17:56:19 2010 UTC
+++
/lambico-core/src/main/java/org/lambico/dao/generic/GenericDaoTypeSupport.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao.generic;

/**
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/generic/MaxResults.java Thu
Jan 7 17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/generic/MaxResults.java Fri
Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao.generic;

import java.lang.annotation.Documented;
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/generic/Page.java Thu Jan
7 17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/generic/Page.java Fri Feb
27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao.generic;

import java.util.List;
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/generic/package-info.java
Thu Jan 7 17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/generic/package-info.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/**
* Generic DAO classes, without any relationship with the specific
implementation, or
* support for a persistence technology.
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/hibernate/package-info.java
Thu Jan 7 17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/hibernate/package-info.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/**
* Generic DAO classes, with support for Hibernate.
*
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/package-info.java Thu Jan
7 17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/package-info.java Fri Feb
27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/**
* DAO support classes.
*
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/spring/BusinessDao.java Thu
Jan 7 17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/spring/BusinessDao.java Fri
Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao.spring;

import java.lang.annotation.Documented;
=======================================
---
/lambico-core/src/main/java/org/lambico/dao/spring/hibernate/GenericDaoHibernateSupport.java
Mon Jan 3 16:54:22 2011 UTC
+++
/lambico-core/src/main/java/org/lambico/dao/spring/hibernate/GenericDaoHibernateSupport.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,11 +15,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao.spring.hibernate;

import org.lambico.dao.generic.GenericDaoTypeSupport;
-import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate4.HibernateTemplate;

/**
* Methods of a generic DAO with support for hibernate.
=======================================
---
/lambico-core/src/main/java/org/lambico/dao/spring/hibernate/package-info.java
Thu Jan 7 17:56:19 2010 UTC
+++
/lambico-core/src/main/java/org/lambico/dao/spring/hibernate/package-info.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/**
* Generic DAO classes, related to a Spring implementation and with
Hibernate as persistence
* mechanism.
=======================================
--- /lambico-core/src/main/java/org/lambico/dao/spring/package-info.java
Thu Jan 7 17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/dao/spring/package-info.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/**
* Generic DAO classes, related to a Spring implementation.
*
=======================================
--- /lambico-core/src/main/java/org/lambico/po/hibernate/package-info.java
Thu Jan 7 17:56:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/po/hibernate/package-info.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/**
* Classes simplifying the creation and manipulation of Hibenrate entities.
*
=======================================
--- /lambico-core/src/main/java/org/lambico/util/package-info.java Sat Feb
6 11:23:19 2010 UTC
+++ /lambico-core/src/main/java/org/lambico/util/package-info.java Fri Feb
27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/**
* Base utility classes.
*
=======================================
---
/lambico-core/src/test/java/org/lambico/dao/generic/PageDefaultImplTest.java
Thu Jan 7 17:56:19 2010 UTC
+++
/lambico-core/src/test/java/org/lambico/dao/generic/PageDefaultImplTest.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.dao.generic;

import java.util.LinkedList;
=======================================
---
/lambico-core/src/test/java/org/lambico/po/hibernate/EntityBaseTest.java
Thu Jan 7 17:56:19 2010 UTC
+++
/lambico-core/src/test/java/org/lambico/po/hibernate/EntityBaseTest.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.po.hibernate;

import org.junit.Test;
=======================================
--- /lambico-spring-hibernate/pom.xml Fri Feb 27 07:43:36 2015 UTC
+++ /lambico-spring-hibernate/pom.xml Fri Feb 27 23:14:01 2015 UTC
@@ -38,6 +38,11 @@
<artifactId>commons-dbcp</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-testing</artifactId>
+ <scope>test</scope>
+ </dependency>
<!-- END test libraries -->
<dependency>
<groupId>org.lambico</groupId>
=======================================
--- /lambico-spring-hibernate/src/main/assembly/library-assembly.xml Tue
Jan 25 14:05:41 2011 UTC
+++ /lambico-spring-hibernate/src/main/assembly/library-assembly.xml Fri
Feb 27 23:14:01 2015 UTC
@@ -18,7 +18,6 @@
limitations under the License.

-->
-
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0
http://maven.apache.org/xsd/assembly-1.1.0.xsd">
=======================================
---
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateDaoBeanCreator.java
Wed Feb 27 16:43:19 2013 UTC
+++
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateDaoBeanCreator.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.spring.dao.hibernate;

import java.util.ArrayList;
=======================================
---
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateDaoInstrumentation.java
Wed Feb 27 16:43:19 2013 UTC
+++
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateDaoInstrumentation.java
Fri Feb 27 23:14:01 2015 UTC
@@ -46,8 +46,8 @@
import org.lambico.dao.spring.hibernate.GenericDaoHibernateSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.orm.hibernate3.HibernateCallback;
-import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate4.HibernateCallback;
+import org.springframework.orm.hibernate4.HibernateTemplate;
import org.springframework.util.StringUtils;

/**
@@ -106,9 +106,10 @@

HibernateTemplate hibernateTemplate =
HibernateDaoUtils.getHibernateTemplate(
((GenericDaoHibernateSupport) target));
+ hibernateTemplate.setExposeNativeSession(true);

// query using a named query from the method name
- result = hibernateTemplate.executeFind(new HibernateCallback()
{
+ result = hibernateTemplate.execute(new HibernateCallback() {

@Override
public Object doInHibernate(final Session session) {
@@ -163,7 +164,7 @@
if (method.getName().startsWith("findBy")
|| method.getName().startsWith("countBy")) {
// Query evicting condition from the method name
- result = hibernateTemplate.executeFind(
+ result = hibernateTemplate.execute(
new HibernateCallback() {

@Override
=======================================
---
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateDaoUtils.java
Wed Mar 2 15:31:42 2011 UTC
+++
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateDaoUtils.java
Fri Feb 27 23:14:01 2015 UTC
@@ -20,7 +20,7 @@
import java.lang.reflect.Method;
import org.lambico.dao.generic.CacheIt;
import org.lambico.dao.spring.hibernate.GenericDaoHibernateSupport;
-import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate4.HibernateTemplate;

/**
* Utility methods for implementing the Hibernate DAO.
=======================================
---
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateGenericBusinessDao.java
Wed Feb 27 16:43:19 2013 UTC
+++
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateGenericBusinessDao.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.spring.dao.hibernate;

import java.io.Serializable;
@@ -37,9 +36,9 @@
import org.lambico.dao.hibernate.GenericDaoHibernateCriteriaSupport;
import org.lambico.dao.spring.BusinessDao;
import org.lambico.dao.spring.hibernate.GenericDaoHibernateSupport;
-import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+import org.springframework.orm.hibernate4.support.HibernateDaoSupport;
import org.springframework.dao.support.DataAccessUtils;
-import org.springframework.orm.hibernate3.HibernateTemplate;
+import org.springframework.orm.hibernate4.HibernateTemplate;

/**
* A generic DAO wich can be extended and personalized.
@@ -123,7 +122,7 @@
@SuppressWarnings("unchecked")
@Override
public void store(final T o) {
- getHibernateTemplate().merge(o);
+ getHibernateTemplate().saveOrUpdate(o);
}

/**
@@ -167,7 +166,7 @@
@SuppressWarnings("unchecked")
@Override
public List<T> findAll() {
- return getHibernateTemplate().find("from " +
persistentClass.getName() + " x");
+ return (List<T>) getHibernateTemplate().find("from " +
persistentClass.getName() + " x");
}

/**
@@ -179,7 +178,7 @@
@SuppressWarnings("unchecked")
@Override
public List<T> searchByCriteria(final Criterion... criterion) {
- Criteria crit = getSession().createCriteria(persistentClass);
+ Criteria crit = currentSession().createCriteria(persistentClass);
for (Criterion c : criterion) {
crit.add(c);
}
@@ -195,7 +194,7 @@
@SuppressWarnings("unchecked")
@Override
public List<T> searchByCriteria(final DetachedCriteria criteria) {
- return getHibernateTemplate().findByCriteria(criteria);
+ return (List<T>) getHibernateTemplate().findByCriteria(criteria);
}

/**
@@ -210,7 +209,7 @@
@Override
public List<T> searchByCriteria(final DetachedCriteria criteria, final
int firstResult,
final int maxResults) {
- return getHibernateTemplate().
+ return (List<T>) getHibernateTemplate().
findByCriteria(criteria, firstResult, maxResults);
}

@@ -226,8 +225,8 @@
@Override
public Page<T> searchPaginatedByCriteria(final int page, final int
pageSize,
final Criterion... criterion) {
- Criteria crit = getSession().createCriteria(persistentClass);
- Criteria count = getSession().createCriteria(persistentClass);
+ Criteria crit = currentSession().createCriteria(persistentClass);
+ Criteria count = currentSession().createCriteria(persistentClass);
for (Criterion c : criterion) {
crit.add(c);
count.add(c);
@@ -261,7 +260,7 @@
criteria.setResultTransformer(Criteria.ROOT_ENTITY);

@SuppressWarnings("unchecked")
- List<T> list = getHibernateTemplate().
+ List<T> list = (List<T>) getHibernateTemplate().
findByCriteria(criteria, (page - 1) * pageSize, pageSize);

return new PageDefaultImpl<T>(list, page, pageSize, rowCount);
@@ -271,7 +270,7 @@
public Page<T> searchPaginatedByCriteria(int page, int pageSize, int
totalRecords,
DetachedCriteria criteria) {
@SuppressWarnings("unchecked")
- List<T> list = getHibernateTemplate().
+ List<T> list = (List<T>) getHibernateTemplate().
findByCriteria(criteria, (page - 1) * pageSize, pageSize);

return new PageDefaultImpl<T>(list, page, pageSize, totalRecords);
=======================================
---
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateGenericDaoImpl.java
Wed Mar 13 17:53:54 2013 UTC
+++
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/HibernateGenericDaoImpl.java
Fri Feb 27 23:14:01 2015 UTC
@@ -19,21 +19,21 @@

import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
-import org.hibernate.classic.Session;
import org.lambico.dao.spring.hibernate.HibernateGenericDao;
import java.io.Serializable;
import java.util.List;
import org.apache.commons.lang.SerializationUtils;
import org.hibernate.Criteria;
+import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.DetachedCriteria;

import org.hibernate.criterion.Projections;
import org.lambico.dao.generic.Page;
import org.lambico.dao.generic.PageDefaultImpl;
-import org.springframework.orm.hibernate3.HibernateTemplate;
-import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.dao.support.DataAccessUtils;
+import org.springframework.orm.hibernate4.HibernateTemplate;
+import org.springframework.orm.hibernate4.support.HibernateDaoSupport;

/**
* Hibernate implementation of the generic DAO.
@@ -124,7 +124,7 @@
@Override
@SuppressWarnings("unchecked")
public final List<T> findAll() {
- return getCustomizedHibernateTemplate().find(
+ return (List<T>) getCustomizedHibernateTemplate().find(
"from " + getType().getName() + " x");
}

@@ -137,7 +137,7 @@
@Override
@SuppressWarnings("unchecked")
public final List<T> searchByCriteria(final Criterion... criterion) {
- Criteria crit = getSession().createCriteria(getType());
+ Criteria crit = currentSession().createCriteria(getType());
for (Criterion c : criterion) {
crit.add(c);
}
@@ -153,7 +153,7 @@
@Override
@SuppressWarnings("unchecked")
public final List<T> searchByCriteria(final DetachedCriteria criteria)
{
- return getCustomizedHibernateTemplate().findByCriteria(criteria);
+ return (List<T>)
getCustomizedHibernateTemplate().findByCriteria(criteria);
}

/**
@@ -168,7 +168,7 @@
@SuppressWarnings("unchecked")
public final List<T> searchByCriteria(final DetachedCriteria criteria,
final int firstResult, final int maxResults) {
- return getCustomizedHibernateTemplate().
+ return (List<T>) getCustomizedHibernateTemplate().
findByCriteria(criteria, firstResult, maxResults);
}

@@ -184,8 +184,8 @@
@SuppressWarnings("unchecked")
public final Page<T> searchPaginatedByCriteria(final int page,
final int pageSize, final Criterion... criterion) {
- Criteria crit = getSession().createCriteria(getType());
- Criteria count = getSession().createCriteria(getType());
+ Criteria crit = currentSession().createCriteria(getType());
+ Criteria count = currentSession().createCriteria(getType());
for (Criterion c : criterion) {
crit.add(c);
count.add(c);
@@ -219,7 +219,7 @@
criteria.setResultTransformer(Criteria.ROOT_ENTITY);

@SuppressWarnings("unchecked")
- List<T> list = getCustomizedHibernateTemplate().
+ List<T> list = (List<T>) getCustomizedHibernateTemplate().
findByCriteria(criteria, (page - 1) * pageSize, pageSize);

return new PageDefaultImpl<T>(list, page, pageSize, rowCount);
@@ -238,7 +238,7 @@
public Page<T> searchPaginatedByCriteria(int page, int pageSize, int
totalRecords,
DetachedCriteria criteria) {
@SuppressWarnings("unchecked")
- List<T> list = getCustomizedHibernateTemplate().
+ List<T> list = (List<T>) getCustomizedHibernateTemplate().
findByCriteria(criteria, (page - 1) * pageSize, pageSize);

return new PageDefaultImpl<T>(list, page, pageSize, totalRecords);
=======================================
---
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/package-info.java
Sat Feb 6 11:14:05 2010 UTC
+++
/lambico-spring-hibernate/src/main/java/org/lambico/spring/dao/hibernate/package-info.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/**
* Spring implementation of generic DAOs with Hibernate support.
*
=======================================
---
/lambico-spring-hibernate/src/main/resources/org/lambico/spring/dao/hibernate/applicationContextBase.xml
Sat Feb 6 11:14:05 2010 UTC
+++
/lambico-spring-hibernate/src/main/resources/org/lambico/spring/dao/hibernate/applicationContextBase.xml
Fri Feb 27 23:14:01 2015 UTC
@@ -18,24 +18,15 @@
limitations under the License.

-->
-
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">

- <bean id="abstractSessionFactory" abstract="true"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
+ <bean id="abstractSessionFactory" abstract="true"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
- <property name="configurationClass"
value="org.hibernate.cfg.AnnotationConfiguration"/>
- <property name="eventListeners">
- <map merge="true">
- <entry key="merge">
- <bean
class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
- </entry>
- </map>
- </property>
</bean>

- <bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+ <bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>

=======================================
---
/lambico-spring-hibernate/src/main/resources/org/lambico/spring/dao/hibernate/genericDao.xml
Sat Feb 6 11:14:05 2010 UTC
+++
/lambico-spring-hibernate/src/main/resources/org/lambico/spring/dao/hibernate/genericDao.xml
Fri Feb 27 23:14:01 2015 UTC
@@ -18,7 +18,6 @@
limitations under the License.

-->
-
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
=======================================
---
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/BaseTest.java
Wed Feb 13 15:29:03 2013 UTC
+++
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/BaseTest.java
Fri Feb 27 23:14:01 2015 UTC
@@ -24,7 +24,10 @@
import org.lambico.spring.dao.hibernate.po.EntityTCWithoutDaoInterface;
import org.lambico.spring.dao.hibernate.pobis.EntityTCBis;
import org.lambico.spring.dao.hibernate.poter.EntityTCTer;
-import org.lambico.test.spring.hibernate.DBTest;
+import org.lambico.test.spring.hibernate.junit4.AbstractBaseTest;
+import org.lambico.test.spring.hibernate.junit4.FixtureSet;
+import org.springframework.test.context.transaction.AfterTransaction;
+import org.springframework.test.context.transaction.BeforeTransaction;

/**
* A base class for lambico tests.
@@ -32,19 +35,18 @@
* @author lucio
* @author michele franzin <michele at franzin.net>
*/
-public abstract class BaseTest extends DBTest {
+@FixtureSet(modelClasses = {EntityTC.class, EntityTCBis.class,
EntityTCTer.class,
+ EntityTCWithoutDaoInterface.class, EntityTCNoInheritance.class,
BookTC.class, AuthorTC.class})
+public abstract class BaseTest extends AbstractBaseTest {

- @Override
- public Class[] getFixtureClasses() {
- return new Class[]{EntityTC.class, EntityTCBis.class,
EntityTCTer.class,
- EntityTCWithoutDaoInterface.class, EntityTCNoInheritance.class,
- BookTC.class, AuthorTC.class};
+ @BeforeTransaction
+ public void beforeTransaction() throws Exception {
+ this.jdbcTemplate.execute("SET DATABASE REFERENTIAL INTEGRITY
FALSE");
}
-
- @Override
- public void onSetUpBeforeTransaction() throws Exception {
- this.getJdbcTemplate().execute("SET DATABASE REFERENTIAL INTEGRITY
FALSE");
- super.onSetUpBeforeTransaction();
- this.getJdbcTemplate().execute("SET DATABASE REFERENTIAL INTEGRITY
TRUE");
+
+ @AfterTransaction
+ public void afterTransaction() throws Exception {
+ this.jdbcTemplate.execute("SET DATABASE REFERENTIAL INTEGRITY
TRUE");
}
+
}
=======================================
---
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/CachedEntityTCTest.java
Thu Feb 28 17:37:27 2013 UTC
+++
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/CachedEntityTCTest.java
Fri Feb 27 23:14:01 2015 UTC
@@ -18,11 +18,23 @@
package org.lambico.spring.dao.hibernate;

import javax.annotation.Resource;
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.*;
import org.hibernate.stat.Statistics;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
import org.lambico.dao.spring.hibernate.HibernateGenericDao;
import org.lambico.spring.dao.hibernate.dao.CachedEntityTCDao;
import org.lambico.spring.dao.hibernate.po.CachedEntityTC;
-import org.lambico.test.spring.hibernate.DBTest;
+import org.lambico.test.spring.hibernate.junit4.AbstractBaseTest;
+import org.springframework.test.context.transaction.AfterTransaction;
+import org.springframework.test.context.transaction.BeforeTransaction;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.TransactionDefinition;
+import org.springframework.transaction.TransactionStatus;
+import org.springframework.transaction.annotation.Transactional;
+import
org.springframework.transaction.support.DefaultTransactionDefinition;

/**
* Tests on caching DAO methods.
@@ -30,31 +42,61 @@
* @author <a href="mailto:lu...@benfante.com">Lucio Benfante</a>
* @version $Revision$
*/
-public class CachedEntityTCTest extends DBTest {
+public class CachedEntityTCTest extends AbstractBaseTest {

public static final int COUNT = 1000;
public static final String FIELD = "%67%";
@Resource
private CachedEntityTCDao cachedEntityTCDao;

- @Override
- protected void prepareTestInstance() throws Exception {
- super.prepareTestInstance();
- for (long i = 0; i < COUNT; i++) {
- cachedEntityTCDao.create(new CachedEntityTC("" + i, "" + i, ""
+ i, i));
+ @BeforeTransaction
+ @Transactional
+ public void prepareTestInstance() throws Exception {
+ PlatformTransactionManager txManager
+ =
this.applicationContext.getBean(PlatformTransactionManager.class);
+ DefaultTransactionDefinition def = new
DefaultTransactionDefinition();
+ def.setName("refreshDatabaseWithFixtures");
+
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
+
+ TransactionStatus status = txManager.getTransaction(def);
+ try {
+ for (long i = 0; i < COUNT; i++) {
+ cachedEntityTCDao.create(new CachedEntityTC("" + i, "" +
i, "" + i, i));
+ }
+ } catch (Exception e) {
+ txManager.rollback(status);
+ throw e;
}
+ txManager.commit(status);
}

- @Override
- protected void endTransaction() {
- cachedEntityTCDao.deleteAll();
- super.endTransaction();
+ @AfterTransaction
+ @Transactional
+ public void endTransaction() throws Exception {
+ PlatformTransactionManager txManager
+ =
this.applicationContext.getBean(PlatformTransactionManager.class);
+ DefaultTransactionDefinition def = new
DefaultTransactionDefinition();
+ def.setName("refreshDatabaseWithFixtures");
+
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
+
+ TransactionStatus status = txManager.getTransaction(def);
+ try {
+ cachedEntityTCDao.deleteAll();
+ } catch (Exception e) {
+ txManager.rollback(status);
+ throw e;
+ }
+ txManager.commit(status);
}

+ @Test
+ @Transactional
public void testAllSize() {
- assertSize(COUNT, cachedEntityTCDao.findAll());
+ assertThat(COUNT, is(cachedEntityTCDao.findAll().size()));
}

+ @Test
+ @Transactional
public void test1() {
final Statistics statistics =
((HibernateGenericDao)
cachedEntityTCDao).getCustomizedHibernateTemplate().
=======================================
---
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/DaoProviderTest.java
Wed Feb 27 16:43:19 2013 UTC
+++
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/DaoProviderTest.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,14 +15,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.spring.dao.hibernate;

import org.lambico.spring.dao.hibernate.dao.TestDaos;
import org.lambico.spring.dao.hibernate.po.EntityTC;
import org.lambico.spring.dao.DaoUtils;
import java.util.Map;
-import org.lambico.test.spring.hibernate.DBTest;
+import org.junit.Test;
+import org.lambico.test.spring.hibernate.junit4.AbstractBaseTest;
+import static org.junit.Assert.*;

/**
* Tests for the DaoProvider classes.
@@ -30,13 +31,14 @@
* @author <a href="mailto:lucio.b...@jugpadova.it">Lucio Benfante</a>
* @version $Revision$
*/
-public class DaoProviderTest extends DBTest {
+public class DaoProviderTest extends AbstractBaseTest {

/**
* Test the retrieval of the DAO map.
*/
+ @Test
public void testGetDaoMap() {
- Map contextDaoMap = (Map)
getApplicationContext().getBean("daoMap");
+ Map contextDaoMap = (Map)
this.applicationContext.getBean("daoMap");
assertNotNull(contextDaoMap);
assertTrue("Test DAO map shouldn't be
empty", !contextDaoMap.isEmpty());
}
@@ -44,8 +46,9 @@
/**
* Test the retrieval of a DAO from the DAO map.
*/
+ @Test
public void testGetDaoFromMap() {
- Map contextDaoMap = (Map)
getApplicationContext().getBean("daoMap");
+ Map contextDaoMap = (Map)
this.applicationContext.getBean("daoMap");
assertNotNull(contextDaoMap);
Object dao = contextDaoMap.get("entityTCDao");
assertNotNull(dao);
@@ -55,8 +58,9 @@
/**
* Test the retrieval of the DAO map from the generic dao provider.
*/
+ @Test
public void testGetDaoMapFromProvider() {
- TestDaos baseDaoProvider = (TestDaos)
getApplicationContext().getBean("daos");
+ TestDaos baseDaoProvider = (TestDaos)
this.applicationContext.getBean("daos");
assertNotNull(baseDaoProvider);
Map contextDaoMap = baseDaoProvider.getDaoMap();
assertNotNull(contextDaoMap);
@@ -66,8 +70,9 @@
/**
* Test the retrieval of a DAO from the generic dao provider.
*/
+ @Test
public void testGetDaoFromProvider() {
- TestDaos baseDaoProvider = (TestDaos)
getApplicationContext().getBean("daos");
+ TestDaos baseDaoProvider = (TestDaos)
this.applicationContext.getBean("daos");
assertNotNull(baseDaoProvider);
Object dao = baseDaoProvider.getDao("entityTCDao");
assertNotNull(dao);
@@ -77,8 +82,9 @@
/**
* Test the retrieval of a DAO for an entity from the generic dao
provider.
*/
+ @Test
public void testGetDaoByEntityFromProvider() {
- TestDaos baseDaoProvider = (TestDaos)
getApplicationContext().getBean("daos");
+ TestDaos baseDaoProvider = (TestDaos)
this.applicationContext.getBean("daos");
assertNotNull(baseDaoProvider);
Object dao = baseDaoProvider.getDao(EntityTC.class);
assertNotNull(dao);
@@ -88,8 +94,9 @@
/**
* Test the retrieval of a DAO for an entity from the generic dao
provider.
*/
+ @Test
public void testGetDaoByMethodFromProvider() {
- TestDaos baseDaoProvider = (TestDaos)
getApplicationContext().getBean("daos");
+ TestDaos baseDaoProvider = (TestDaos)
this.applicationContext.getBean("daos");
assertNotNull(baseDaoProvider);
Object dao = baseDaoProvider.getEntityTCDao();
assertNotNull(dao);
=======================================
---
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCBisTest.java
Sat Feb 6 11:14:05 2010 UTC
+++
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCBisTest.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,13 +15,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.spring.dao.hibernate;

import java.util.List;
import javax.annotation.Resource;
import org.lambico.spring.dao.hibernate.daobis.EntityTCBisDao;
import org.lambico.spring.dao.hibernate.pobis.EntityTCBis;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import static org.lambico.test.ExtraAssert.*;

/**
* Tests on generic DAO with DAOs and entities in multiple separated
packages.
@@ -34,10 +36,12 @@
@Resource
private EntityTCBisDao entityTCBisDao;

+ @Test
public void testDaoExists() {
assertNotNull(entityTCBisDao);
}

+ @Test
public void testAllSize() {
final List<EntityTCBis> result = entityTCBisDao.findAll();
assertSize(5, result);
=======================================
---
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCNoInheritanceTest.java
Mon Feb 15 17:17:05 2010 UTC
+++
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCNoInheritanceTest.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,13 +15,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.spring.dao.hibernate;

import java.util.List;
import javax.annotation.Resource;
import org.lambico.dao.generic.GenericDao;
import org.lambico.spring.dao.hibernate.po.EntityTCNoInheritance;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import static org.lambico.test.ExtraAssert.*;

/**
* Tests on generic DAO without defining a specific DAO interface.
@@ -34,15 +36,18 @@
@Resource
private GenericDao<EntityTCNoInheritance, Short>
entityTCNoInheritanceDao;

+ @Test
public void testDaoExists() {
assertNotNull(entityTCNoInheritanceDao);
}

+ @Test
public void testAllSize() {
final List<EntityTCNoInheritance> result =
entityTCNoInheritanceDao.findAll();
assertSize(5, result);
EntityTCNoInheritance testCast = result.get(0);
}

+ @Test
public void testEmpty() {}
}
=======================================
---
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCTerTest.java
Fri Mar 4 17:45:44 2011 UTC
+++
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCTerTest.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,13 +15,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.spring.dao.hibernate;

import java.util.List;
import javax.annotation.Resource;
import org.lambico.spring.dao.hibernate.daoter.EntityTCTerDao;
import org.lambico.spring.dao.hibernate.poter.EntityTCTer;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import static org.lambico.test.ExtraAssert.*;

/**
* Tests on generic DAO with DAOs and entities in multiple separated
packages.
@@ -34,16 +36,19 @@
@Resource
private EntityTCTerDao entityTCTerDao;

+ @Test
public void testDaoExists() {
assertNotNull(entityTCTerDao);
}

+ @Test
public void testAllSize() {
final List<EntityTCTer> result = entityTCTerDao.findAll();
assertSize(1, result);
EntityTCTer testCast = result.get(0);
}

+ @Test
public void testFindByFieldOne() {
final List<EntityTCTer> result =
entityTCTerDao.findByFieldOne("one1");
assertSize(0, result);
=======================================
---
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCTest.java
Wed Feb 27 16:43:19 2013 UTC
+++
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCTest.java
Fri Feb 27 23:14:01 2015 UTC
@@ -25,6 +25,9 @@
import javax.annotation.Resource;
import org.hibernate.criterion.DetachedCriteria;
import org.lambico.dao.hibernate.GenericDaoHibernateCriteriaSupport;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import static org.lambico.test.ExtraAssert.*;

/**
* Tests on generic DAO using EntityTC.
@@ -39,15 +42,18 @@
@Resource
private EntityTCDao entityTCDao;

+ @Test
public void testDaoExists() {
assertNotNull(this.daos);
assertNotNull(this.daos.getEntityTCDao());
}

+ @Test
public void testAllSize() {
assertSize(5, this.daos.getEntityTCDao().findAll());
}

+ @Test
public void testOrderByFieldOne() {
List<EntityTC> entities =
this.daos.getEntityTCDao().findByOrderByFieldOne();
assertNotEmpty(entities);
@@ -60,6 +66,7 @@
}
}

+ @Test
public void testOrderByFieldTwo() {
List<EntityTC> entities =
this.daos.getEntityTCDao().findByOrderByFieldTwo();
assertNotEmpty(entities);
@@ -72,6 +79,7 @@
}
}

+ @Test
public void testOrderByFieldOneAndFieldTwo() {
List<EntityTC> entities =
this.daos.getEntityTCDao().findByOrderByFieldOneAndFieldTwo();
assertNotEmpty(entities);
@@ -89,12 +97,14 @@
}
}

+ @Test
public void testFindSingleRecord() {
EntityTC entityTC =
this.daos.getEntityTCDao().findByFieldOneOrderByFieldTwo("one1");
assertNotNull(entityTC);
assertEquals("one1", entityTC.getFieldOne());
}

+ @Test
public void testFindOrderedSingleRecord() {
EntityTCDao dao = this.daos.getEntityTCDao();
List<EntityTC> entities = dao.findByFieldOne("one3");
@@ -105,6 +115,7 @@
assertEquals("two1", entityTC.getFieldTwo());
}

+ @Test
public void testFindByOrderByFieldTwoWithFirstRecordAndMaxRecords() {
EntityTCDao dao = this.daos.getEntityTCDao();
List<EntityTC> entities = dao.findByOrderByFieldOne(1, 2);
@@ -112,13 +123,15 @@
assertEquals("one2", entities.get(0).getFieldOne());
}

+ @Test
public void testFindByOrderByFieldTwoWithFirstRecordAndNoMaxRecords() {
- EntityTCDao dao = this.daos.getEntityTCDao();
+ EntityTCDao dao = entityTCDao;
List<EntityTC> entities = dao.findByOrderByFieldOne(1, -1);
assertSize(4, entities);
assertEquals("one2", entities.get(0).getFieldOne());
}

+ @Test
public void testSearchAllOrderByFieldTwoWithFirstRecordAndMaxRecords()
{
EntityTCDao dao = this.daos.getEntityTCDao();
List<EntityTC> entities = dao.searchAllOrderByFieldOne(1, 2);
@@ -126,6 +139,7 @@
assertEquals("one2", entities.get(0).getFieldOne());
}

+ @Test
public void
testSearchAllOrderByFieldTwoWithFirstRecordAndNoMaxRecords() {
EntityTCDao dao = this.daos.getEntityTCDao();
List<EntityTC> entities = dao.searchAllOrderByFieldOne(1, -1);
@@ -133,12 +147,14 @@
assertEquals("one2", entities.get(0).getFieldOne());
}

+ @Test
public void testFindByFieldThree() {
EntityTCDao dao = this.daos.getEntityTCDao();
List<EntityTC> entities = dao.findByFieldThree("t%");
assertSize(4, entities);
}

+ @Test
public void testFindAllByCriteria() {
@SuppressWarnings("unchecked")
List<EntityTC> results =
((GenericDaoHibernateCriteriaSupport<EntityTC>) entityTCDao).
@@ -146,12 +162,14 @@
assertSize(5, results);
}

+ @Test
public void testWithNamedParameters() {
List<EntityTC> results =
entityTCDao.findByFieldOneAndFieldTwoAndFieldThreeWithName("one3",
"two3", "Three3");
assertSize(1, results);
}

+ @Test
public void testSearchByFieldOneList() {
List<String> values = new ArrayList<String>();
values.add("one1");
@@ -160,6 +178,7 @@
assertSize(3, result);
}

+ @Test
public void testSearchByFieldOneArray() {
String[] values = {"one1", "one3"};
List<EntityTC> result = entityTCDao.searchByFieldOneArray(values);
=======================================
---
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCWithoutDaoInterfaceTest.java
Sat Feb 6 11:14:05 2010 UTC
+++
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/EntityTCWithoutDaoInterfaceTest.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,13 +15,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.spring.dao.hibernate;

import java.util.List;
import javax.annotation.Resource;
import org.lambico.dao.generic.GenericDao;
import org.lambico.spring.dao.hibernate.po.EntityTCWithoutDaoInterface;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import static org.lambico.test.ExtraAssert.*;

/**
* Tests on generic DAO without defining a specific DAO interface.
@@ -34,10 +36,12 @@
@Resource
private GenericDao<EntityTCWithoutDaoInterface, Long>
entityTCWithoutDaoInterfaceDao;

+ @Test
public void testDaoExists() {
assertNotNull(entityTCWithoutDaoInterfaceDao);
}

+ @Test
public void testAllSize() {
final List<EntityTCWithoutDaoInterface> result =
entityTCWithoutDaoInterfaceDao.findAll();
assertSize(5, result);
=======================================
---
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/HibernateDaoBeanCreatorTest.java
Fri Mar 4 16:54:33 2011 UTC
+++
/lambico-spring-hibernate/src/test/java/org/lambico/spring/dao/hibernate/HibernateDaoBeanCreatorTest.java
Fri Feb 27 23:14:01 2015 UTC
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.lambico.spring.dao.hibernate;

import java.util.Set;
=======================================
***Additional files exist in this changeset.***
Reply all
Reply to author
Forward
0 new messages