[jboss-cvs] jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay ...
Shane Bryzak
sbryzak at redhat.com
Wed Apr 11 03:16:04 EDT 2007
User: sbryzak2
Date: 07/04/11 03:16:04
Modified: examples/seambay/src/org/jboss/seam/example/seambay
Auction.java AuctionSearchAction.java
Log:
split web services into separate groups
Revision Changes Path
1.5 +3 -0 jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/Auction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Auction.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/Auction.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- Auction.java 10 Apr 2007 01:42:38 -0000 1.4
+++ Auction.java 11 Apr 2007 07:16:04 -0000 1.5
@@ -122,6 +122,9 @@
@Transient
public String getTimeLeft()
{
+ if (endDate == null)
+ return null;
+
return (endDate.getTime() - System.currentTimeMillis()) + "ms";
}
1.5 +8 -2 jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionSearchAction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AuctionSearchAction.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/seambay/src/org/jboss/seam/example/seambay/AuctionSearchAction.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- AuctionSearchAction.java 2 Apr 2007 05:39:24 -0000 1.4
+++ AuctionSearchAction.java 11 Apr 2007 07:16:04 -0000 1.5
@@ -43,11 +43,14 @@
if (searchCategory == null)
{
- qry = "from Auction a where lower(title) like #{searchPattern}";
+ qry = "from Auction a where lower(title) like #{searchPattern} " +
+ "and a.status = 1 and a.endDate >= #{currentDatetime}";
}
else
{
- qry = "from Auction a where lower(title) like #{searchPattern} and a.category = #{searchCategory}";
+ qry = "from Auction a where lower(title) like #{searchPattern} " +
+ "and a.category = #{searchCategory} and a.status = 1 " +
+ "and a.endDate >= #{currentDateTime}";
}
auctions = entityManager.createQuery(qry)
@@ -60,6 +63,7 @@
for (Object[] result : (List<Object[]>) entityManager.createQuery(
"select a.category.categoryId, count(a) from Auction a " +
"where lower(a.title) like #{searchPattern} " +
+ "and a.endDate >= #{currentDateTime} and a.status = 1 " +
"group by a.category.categoryId")
.getResultList())
{
@@ -80,6 +84,8 @@
"%" : '%' + searchTerm.toLowerCase().replace('*', '%') + '%';
}
+ @Factory
+
public String getSearchTerm()
{
return searchTerm;
More information about the jboss-cvs-commits
mailing list