Author: pete.muir(a)jboss.org
Date: 2010-06-18 09:24:29 -0400 (Fri, 18 Jun 2010)
New Revision: 6484
Modified:
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/CodeFragmentManagerImpl.java
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/FloodingDecorator.java
Log:
fix search
Modified:
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/CodeFragmentManagerImpl.java
===================================================================
---
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/CodeFragmentManagerImpl.java 2010-06-18
11:35:05 UTC (rev 6483)
+++
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/CodeFragmentManagerImpl.java 2010-06-18
13:24:29 UTC (rev 6484)
@@ -28,7 +28,7 @@
import java.util.List;
import java.util.logging.Logger;
-import javax.ejb.Stateless;
+import javax.ejb.Stateful;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import javax.inject.Named;
@@ -43,7 +43,7 @@
import org.jboss.weld.examples.pastecode.model.CodeFragment;
import org.jboss.weld.examples.pastecode.model.CodeFragment_;
-@Stateless
+@Stateful
public class CodeFragmentManagerImpl implements CodeFragmentManager
{
@@ -194,7 +194,7 @@
}
if (!isEmpty(codeFragment.getText()))
{
- predicates.add( builder.like(root.get(CodeFragment_.text),
codeFragment.getText().toLowerCase()) );
+ predicates.add( builder.like(root.get(CodeFragment_.text), "%" +
codeFragment.getText().toLowerCase().trim() + "%") );
}
if (codeFragment.getDatetime() != null)
{
Modified:
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/FloodingDecorator.java
===================================================================
---
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/FloodingDecorator.java 2010-06-18
11:35:05 UTC (rev 6483)
+++
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/FloodingDecorator.java 2010-06-18
13:24:29 UTC (rev 6484)
@@ -21,6 +21,8 @@
*/
package org.jboss.weld.examples.pastecode.session;
+import java.io.Serializable;
+
import javax.decorator.Decorator;
import javax.decorator.Delegate;
import javax.inject.Inject;
@@ -28,8 +30,11 @@
import org.jboss.weld.examples.pastecode.model.CodeFragment;
@Decorator
-public abstract class FloodingDecorator implements CodeFragmentManager
+public abstract class FloodingDecorator implements CodeFragmentManager, Serializable
{
+
+ private static final long serialVersionUID = -4615837206290420112L;
+
@Inject @Delegate
private CodeFragmentManager codeFragmentManager;
Show replies by date