[jboss-cvs] JBossAS SVN: r101057 - in projects/snowdrop/examples/trunk/sportsclub: assembly and 11 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Feb 16 21:53:03 EST 2010
Author: marius.bogoevici
Date: 2010-02-16 21:53:02 -0500 (Tue, 16 Feb 2010)
New Revision: 101057
Added:
projects/snowdrop/examples/trunk/sportsclub/assembly/
projects/snowdrop/examples/trunk/sportsclub/assembly/assembly.iml
projects/snowdrop/examples/trunk/sportsclub/assembly/pom.xml
projects/snowdrop/examples/trunk/sportsclub/assembly/src/
projects/snowdrop/examples/trunk/sportsclub/assembly/src/assembly/
projects/snowdrop/examples/trunk/sportsclub/assembly/src/assembly/src.xml
projects/snowdrop/examples/trunk/sportsclub/assembly/src/main/
projects/snowdrop/examples/trunk/sportsclub/assembly/src/main/java/
projects/snowdrop/examples/trunk/sportsclub/assembly/src/test/
projects/snowdrop/examples/trunk/sportsclub/assembly/src/test/java/
Modified:
projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Chapter.xml
projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Preface.xml
projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/guide.xml
projects/snowdrop/examples/trunk/sportsclub/pom.xml
projects/snowdrop/examples/trunk/sportsclub/sportsclub-domain/src/main/java/org/jboss/snowdrop/samples/sportsclub/domain/repository/criteria/InvoiceSearchCriteria.java
projects/snowdrop/examples/trunk/sportsclub/sportsclub-hibernate-dao/src/main/java/org/jboss/snowdrop/samples/sportsclub/dao/hibernate/HibernateAccountRepository.java
projects/snowdrop/examples/trunk/sportsclub/sportsclub-hibernate-dao/src/test/java/org/jboss/snowdrop/samples/sportsclub/dao/hibernate/TestHibernateAccountRepository.java
projects/snowdrop/examples/trunk/sportsclub/sportsclub-jpa-dao/src/main/java/org/jboss/snowdrop/samples/sportsclub/dao/jpa/JpaAccountRepository.java
projects/snowdrop/examples/trunk/sportsclub/sportsclub-jpa-dao/src/test/java/org/jboss/snowdrop/samples/sportsclub/dao/jpa/TestJpaAccountRepository.java
projects/snowdrop/examples/trunk/sportsclub/sportsclub-subscriptions-ejb/src/main/java/org/jboss/snowdrop/samples/sportsclub/ejb/SubscriptionServiceImpl.java
Log:
Adding source assembly, fixing test issues
Added: projects/snowdrop/examples/trunk/sportsclub/assembly/assembly.iml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/assembly/assembly.iml (rev 0)
+++ projects/snowdrop/examples/trunk/sportsclub/assembly/assembly.iml 2010-02-17 02:53:02 UTC (rev 101057)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: org.hibernate:hibernate-annotations:3.4.0.GA" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: org.hibernate:ejb3-persistence:1.0.2.GA" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: org.hibernate:hibernate-commons-annotations:3.1.0.GA" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.5.8" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: org.hibernate:hibernate-core:3.3.1.GA" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: antlr:antlr:2.7.6" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: commons-collections:commons-collections:3.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: dom4j:dom4j:1.6.1" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven: javax.transaction:jta:1.1" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: org.slf4j:slf4j-simple:1.5.8" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: javassist:javassist:3.11.0.GA" level="project" />
+ </component>
+</module>
+
Added: projects/snowdrop/examples/trunk/sportsclub/assembly/pom.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/assembly/pom.xml (rev 0)
+++ projects/snowdrop/examples/trunk/sportsclub/assembly/pom.xml 2010-02-17 02:53:02 UTC (rev 101057)
@@ -0,0 +1,42 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>sportsclub-parent</artifactId>
+ <groupId>org.jboss.snowdrop.samples.sportsclub</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>assembly</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Sports Club Source Assembly</name>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-5</version>
+ <executions>
+ <execution>
+ <id>make-source-distros</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>snowdrop-example-sportsclub</finalName>
+ <descriptors>
+ <descriptor>${basedir}/src/assembly/src.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Added: projects/snowdrop/examples/trunk/sportsclub/assembly/src/assembly/src.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/assembly/src/assembly/src.xml (rev 0)
+++ projects/snowdrop/examples/trunk/sportsclub/assembly/src/assembly/src.xml 2010-02-17 02:53:02 UTC (rev 101057)
@@ -0,0 +1,16 @@
+<assembly>
+ <id>src</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <fileSets>
+ <fileSet>
+ <directory>..</directory>
+ <outputDirectory>/</outputDirectory>
+ <excludes>
+ <exclude>**/target/**</exclude>
+ <exclude>sportsclub-ear</exclude>
+ </excludes>
+ </fileSet>
+ </fileSets>
+</assembly>
Modified: projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Chapter.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Chapter.xml 2010-02-17 02:11:06 UTC (rev 101056)
+++ projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Chapter.xml 2010-02-17 02:53:02 UTC (rev 101057)
@@ -6,5 +6,20 @@
<chapter id="chap-guide-Test_Chapter">
<title>Introduction</title>
<para>
- This chapter describes the puporse of the example, as well as the general structure of the documentation.</para>
+ This chapter describes the purpose of the example, as well as the general structure of the documentation.</para>
+ <section>
+ <title>Prerequisites</title>
+ <para>Running the example requires the following setup:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Java 6 JDK</para>
+ </listitem>
+ <listitem>
+ <para>JBoss AS 5.1.0 GA or higher, </para>
+ </listitem>
+ <listitem>
+ <para>Maven 2.0.8 or higher</para>
+ </listitem>
+ </itemizedlist>
+ </section>
</chapter>
Modified: projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Preface.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Preface.xml 2010-02-17 02:11:06 UTC (rev 101056)
+++ projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/Preface.xml 2010-02-17 02:53:02 UTC (rev 101057)
@@ -1,21 +1,18 @@
-<?xml version='1.0' encoding='utf-8' ?>
+<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "guide.ent">
%BOOK_ENTITIES;
]>
<preface id="pref-guide-Preface">
- <title>Preface</title>
- <!-- for publican -->
- <xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" >
- <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
- <xi:include href="fallback_content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- </xi:fallback>
- </xi:include>
- <!-- for publican -->
- <xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
- <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
- <xi:include href="fallback_content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- </xi:fallback>
- </xi:include>
+ <title>Preface</title>
+<!-- for publican --> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Common_Content/Conventions.xml">
+ <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="fallback_content/Conventions.xml"/>
+ </xi:fallback>
+ </xi:include>
+<!-- for publican --> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Feedback.xml">
+ <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="fallback_content/Feedback.xml"/>
+ </xi:fallback>
+ </xi:include>
</preface>
-
Modified: projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/guide.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/guide.xml 2010-02-17 02:11:06 UTC (rev 101056)
+++ projects/snowdrop/examples/trunk/sportsclub/docs/guide/en-US/guide.xml 2010-02-17 02:53:02 UTC (rev 101057)
@@ -1,4 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
+<!-- This document was created with Syntext Serna Free. -->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "guide.ent">
%BOOK_ENTITIES;
Modified: projects/snowdrop/examples/trunk/sportsclub/pom.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/pom.xml 2010-02-17 02:11:06 UTC (rev 101056)
+++ projects/snowdrop/examples/trunk/sportsclub/pom.xml 2010-02-17 02:53:02 UTC (rev 101057)
@@ -20,6 +20,7 @@
<module>sportsclub-invoicing-ejb</module>
<module>sportsclub-invoicing-webmvc</module>
<module>sportsclub-jpa-ear</module>
+ <module>assembly</module>
</modules>
<packaging>pom</packaging>
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-domain/src/main/java/org/jboss/snowdrop/samples/sportsclub/domain/repository/criteria/InvoiceSearchCriteria.java
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-domain/src/main/java/org/jboss/snowdrop/samples/sportsclub/domain/repository/criteria/InvoiceSearchCriteria.java 2010-02-17 02:11:06 UTC (rev 101056)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-domain/src/main/java/org/jboss/snowdrop/samples/sportsclub/domain/repository/criteria/InvoiceSearchCriteria.java 2010-02-17 02:53:02 UTC (rev 101057)
@@ -1,19 +1,38 @@
package org.jboss.snowdrop.samples.sportsclub.domain.repository.criteria;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.jboss.snowdrop.samples.sportsclub.utils.DateUtils;
+
/**
* @author <a href="mailto:lvlcek at redhat.com">Lukas Vlcek</a>
*/
public class InvoiceSearchCriteria
{
- private boolean currentInvoice;
+ private Date referenceDate;
- public boolean isCurrentInvoice()
+ private boolean existingInvoice;
+
+ public InvoiceSearchCriteria(Date referenceDate)
{
- return currentInvoice;
+ this.referenceDate = DateUtils.normalizeDate(referenceDate, TimeZone.getTimeZone("EST"));
}
- public void setCurrentInvoice(boolean currentInvoice)
+ public void setExistingInvoice(boolean existingInvoice)
{
- this.currentInvoice = currentInvoice;
+ this.existingInvoice = existingInvoice;
}
+
+ public boolean isExistingInvoice()
+ {
+ return existingInvoice;
+ }
+
+ public Date getReferenceDate()
+ {
+ return referenceDate;
+ }
+
+
}
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-hibernate-dao/src/main/java/org/jboss/snowdrop/samples/sportsclub/dao/hibernate/HibernateAccountRepository.java
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-hibernate-dao/src/main/java/org/jboss/snowdrop/samples/sportsclub/dao/hibernate/HibernateAccountRepository.java 2010-02-17 02:11:06 UTC (rev 101056)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-hibernate-dao/src/main/java/org/jboss/snowdrop/samples/sportsclub/dao/hibernate/HibernateAccountRepository.java 2010-02-17 02:53:02 UTC (rev 101057)
@@ -55,12 +55,12 @@
}
if (accountSearchCriteria.getInvoiceSearchCriteria() != null)
{
- Timestamp now = new Timestamp(System.currentTimeMillis());
+ Timestamp now = new Timestamp(accountSearchCriteria.getInvoiceSearchCriteria().getReferenceDate().getTime());
DetachedCriteria invcEntries = DetachedCriteria.forClass(Invoice.class)
.setProjection(Property.forName("account.id"));
invcEntries.add(and(le("billingPeriod.startDate", now), ge("billingPeriod.endDate", now)));
- if (accountSearchCriteria.getInvoiceSearchCriteria().isCurrentInvoice())
+ if (accountSearchCriteria.getInvoiceSearchCriteria().isExistingInvoice())
criteria.add(Subqueries.propertyIn("id", invcEntries));
else
criteria.add(Subqueries.propertyNotIn("id", invcEntries));
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-hibernate-dao/src/test/java/org/jboss/snowdrop/samples/sportsclub/dao/hibernate/TestHibernateAccountRepository.java
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-hibernate-dao/src/test/java/org/jboss/snowdrop/samples/sportsclub/dao/hibernate/TestHibernateAccountRepository.java 2010-02-17 02:11:06 UTC (rev 101056)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-hibernate-dao/src/test/java/org/jboss/snowdrop/samples/sportsclub/dao/hibernate/TestHibernateAccountRepository.java 2010-02-17 02:53:02 UTC (rev 101057)
@@ -1,6 +1,8 @@
package org.jboss.snowdrop.samples.sportsclub.dao.hibernate;
import java.util.Collection;
+import java.util.Date;
+import java.util.GregorianCalendar;
import java.util.List;
import org.jboss.snowdrop.samples.sportsclub.domain.entity.Account;
@@ -9,6 +11,8 @@
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
+import sun.misc.GC;
+
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -27,6 +31,7 @@
@Autowired
AccountRepository accountRepository;
+ private static final Date TEST_DATE = new GregorianCalendar(2010, 1, 4).getTime();
@Test
public void testAccountRepository()
@@ -56,8 +61,8 @@
public void testAccountRepositoryWithInvoices()
{
AccountSearchCriteria criteria = new AccountSearchCriteria();
- criteria.setInvoiceSearchCriteria(new InvoiceSearchCriteria());
- criteria.getInvoiceSearchCriteria().setCurrentInvoice(true);
+ criteria.setInvoiceSearchCriteria(new InvoiceSearchCriteria(TEST_DATE));
+ criteria.getInvoiceSearchCriteria().setExistingInvoice(true);
List<Account> accountList = accountRepository.findByCriteria(criteria);
Assert.assertEquals(1, accountList.size());
Account account = accountList.get(0);
@@ -69,8 +74,8 @@
public void testAccountRepositoryWithoutInvoices()
{
AccountSearchCriteria criteria = new AccountSearchCriteria();
- criteria.setInvoiceSearchCriteria(new InvoiceSearchCriteria());
- criteria.getInvoiceSearchCriteria().setCurrentInvoice(false);
+ criteria.setInvoiceSearchCriteria(new InvoiceSearchCriteria(TEST_DATE));
+ criteria.getInvoiceSearchCriteria().setExistingInvoice(false);
List<Account> accountList = accountRepository.findByCriteria(criteria);
Assert.assertEquals(11, accountList.size());
for (Account account : accountList)
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-jpa-dao/src/main/java/org/jboss/snowdrop/samples/sportsclub/dao/jpa/JpaAccountRepository.java
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-jpa-dao/src/main/java/org/jboss/snowdrop/samples/sportsclub/dao/jpa/JpaAccountRepository.java 2010-02-17 02:11:06 UTC (rev 101056)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-jpa-dao/src/main/java/org/jboss/snowdrop/samples/sportsclub/dao/jpa/JpaAccountRepository.java 2010-02-17 02:53:02 UTC (rev 101057)
@@ -8,7 +8,6 @@
import javax.persistence.Query;
import java.util.List;
-import java.sql.Timestamp;
/**
* @author Marius Bogoevici
@@ -60,7 +59,7 @@
}
if (criteria.getInvoiceSearchCriteria() != null)
{
- String not = (!criteria.getInvoiceSearchCriteria().isCurrentInvoice() ? "NOT" : "");
+ String not = (!criteria.getInvoiceSearchCriteria().isExistingInvoice() ? "NOT" : "");
q += " AND a.id "+not+" IN (SELECT i.account.id FROM " + Invoice.class.getSimpleName() +
" i WHERE :now between i.billingPeriod.startDate and i.billingPeriod.endDate )";
}
@@ -81,9 +80,9 @@
{
query.setParameter("city", "%" + criteria.getPersonSearchCriteria().getCity() + "%");
}
- if (criteria.getInvoiceSearchCriteria() != null)
+ if (criteria.getInvoiceSearchCriteria() != null && criteria.getInvoiceSearchCriteria().getReferenceDate() != null)
{
- query.setParameter("now", new Timestamp(System.currentTimeMillis()));
+ query.setParameter("now", criteria.getInvoiceSearchCriteria().getReferenceDate());
}
return query;
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-jpa-dao/src/test/java/org/jboss/snowdrop/samples/sportsclub/dao/jpa/TestJpaAccountRepository.java
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-jpa-dao/src/test/java/org/jboss/snowdrop/samples/sportsclub/dao/jpa/TestJpaAccountRepository.java 2010-02-17 02:11:06 UTC (rev 101056)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-jpa-dao/src/test/java/org/jboss/snowdrop/samples/sportsclub/dao/jpa/TestJpaAccountRepository.java 2010-02-17 02:53:02 UTC (rev 101057)
@@ -15,6 +15,8 @@
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.Collection;
+import java.util.Date;
+import java.util.GregorianCalendar;
import java.util.List;
/**
@@ -31,6 +33,8 @@
@Autowired
InvoiceRepository invoiceRepository;
+
+ public static final Date TEST_DATE = new GregorianCalendar(2010, 1, 4).getTime();
@Test
public void testAccountRepository()
@@ -60,8 +64,8 @@
public void testAccountRepositoryWithInvoices()
{
AccountSearchCriteria criteria = new AccountSearchCriteria();
- criteria.setInvoiceSearchCriteria(new InvoiceSearchCriteria());
- criteria.getInvoiceSearchCriteria().setCurrentInvoice(true);
+ criteria.setInvoiceSearchCriteria(new InvoiceSearchCriteria(TEST_DATE));
+ criteria.getInvoiceSearchCriteria().setExistingInvoice(true);
List<Account> accountList = accountRepository.findByCriteria(criteria);
Assert.assertEquals(1, accountList.size());
Account account = accountList.get(0);
@@ -73,8 +77,8 @@
public void testAccountRepositoryWithoutInvoices()
{
AccountSearchCriteria criteria = new AccountSearchCriteria();
- criteria.setInvoiceSearchCriteria(new InvoiceSearchCriteria());
- criteria.getInvoiceSearchCriteria().setCurrentInvoice(false);
+ criteria.setInvoiceSearchCriteria(new InvoiceSearchCriteria(TEST_DATE));
+ criteria.getInvoiceSearchCriteria().setExistingInvoice(false);
List<Account> accountList = accountRepository.findByCriteria(criteria);
Assert.assertEquals(11, accountList.size());
for (Account account : accountList)
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-subscriptions-ejb/src/main/java/org/jboss/snowdrop/samples/sportsclub/ejb/SubscriptionServiceImpl.java
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-subscriptions-ejb/src/main/java/org/jboss/snowdrop/samples/sportsclub/ejb/SubscriptionServiceImpl.java 2010-02-17 02:11:06 UTC (rev 101056)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-subscriptions-ejb/src/main/java/org/jboss/snowdrop/samples/sportsclub/ejb/SubscriptionServiceImpl.java 2010-02-17 02:53:02 UTC (rev 101057)
@@ -52,8 +52,12 @@
{
PersonSearchCriteria personSearchCriteria = new PersonSearchCriteria();
personSearchCriteria.setName(name);
- InvoiceSearchCriteria invoiceSearchCriteria = new InvoiceSearchCriteria();
- invoiceSearchCriteria.setCurrentInvoice(currentInvoice);
+ InvoiceSearchCriteria invoiceSearchCriteria = null;
+ if (currentInvoice)
+ {
+ invoiceSearchCriteria = new InvoiceSearchCriteria(new Date());
+ invoiceSearchCriteria.setExistingInvoice(currentInvoice);
+ }
AccountSearchCriteria accountSearchCriteria = new AccountSearchCriteria();
accountSearchCriteria.setPersonSearchCriteria(personSearchCriteria);
accountSearchCriteria.setInvoiceSearchCriteria(invoiceSearchCriteria);
More information about the jboss-cvs-commits
mailing list