[seam-commits] Seam SVN: r8858 - trunk/ui/src/main/java/org/jboss/seam/ui.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Sat Aug 30 11:41:27 EDT 2008
Author: pete.muir at jboss.org
Date: 2008-08-30 11:41:27 -0400 (Sat, 30 Aug 2008)
New Revision: 8858
Modified:
trunk/ui/src/main/java/org/jboss/seam/ui/EntityConverter.java
Log:
JBSEAM-3360
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/EntityConverter.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/EntityConverter.java 2008-08-30 14:00:21 UTC (rev 8857)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/EntityConverter.java 2008-08-30 15:41:27 UTC (rev 8858)
@@ -9,6 +9,7 @@
import javax.faces.context.FacesContext;
import javax.faces.convert.ConverterException;
+import org.hibernate.loader.entity.EntityLoader;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
@@ -36,7 +37,14 @@
public AbstractEntityLoader getEntityLoader()
{
- return entityLoader;
+ if (entityLoader == null)
+ {
+ return AbstractEntityLoader.instance();
+ }
+ else
+ {
+ return entityLoader;
+ }
}
public void setEntityLoader(AbstractEntityLoader entityLoader)
@@ -44,16 +52,6 @@
this.entityLoader = entityLoader;
}
- @Create
- public void create()
- {
- if (entityLoader == null)
- {
- entityLoader = AbstractEntityLoader.instance();
- }
- entityLoader.validate();
- }
-
@SuppressWarnings("unchecked")
@Transactional
public String getAsString(FacesContext facesContext, UIComponent cmp, Object value) throws ConverterException
@@ -66,7 +64,7 @@
{
return (String) value;
}
- return entityLoader.put(value);
+ return getEntityLoader().put(value);
}
@@ -77,7 +75,7 @@
{
return null;
}
- return entityLoader.get(value);
+ return getEntityLoader().get(value);
}
}
More information about the seam-commits
mailing list