[jboss-cvs] jboss-seam/src/ui/org/jboss/seam/ui ...
Peter Muir
peter at bleepbleep.org.uk
Mon Apr 30 17:16:08 EDT 2007
User: pmuir
Date: 07/04/30 17:16:08
Modified: src/ui/org/jboss/seam/ui EntityConverter.java
Log:
JBSEAM-1263
Revision Changes Path
1.5 +34 -1 jboss-seam/src/ui/org/jboss/seam/ui/EntityConverter.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EntityConverter.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/ui/org/jboss/seam/ui/EntityConverter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- EntityConverter.java 15 Apr 2007 17:41:22 -0000 1.4
+++ EntityConverter.java 30 Apr 2007 21:16:08 -0000 1.5
@@ -6,6 +6,7 @@
import java.io.Serializable;
+import javax.faces.component.StateHolder;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.ConverterException;
@@ -41,6 +42,11 @@
public void create()
{
entityIdentifierStore = EntityConverterStore.instance();
+
+ }
+
+ private void init()
+ {
if (getEntityManager() != null)
{
entityIdentifierStore.setEntityManager(getEntityManager());
@@ -51,7 +57,7 @@
@Transactional
public String getAsString(FacesContext facesContext, UIComponent cmp, Object value) throws ConverterException
{
-
+ init();
if (value == null)
{
return null;
@@ -67,6 +73,7 @@
@Transactional
public Object getAsObject(FacesContext facesContext, UIComponent cmp, String value) throws ConverterException
{
+ init();
if (value == null)
{
return null;
@@ -82,4 +89,30 @@
private EntityManager getEntityManager() {
return entityManager == null ? null : entityManager.getValue();
}
+
+ /*private boolean _transient;
+
+ public boolean isTransient()
+ {
+ return _transient;
+ }
+
+ public void restoreState(FacesContext context, Object object)
+ {
+ Object[] state = (Object[]) object;
+ entityManager = (ValueBinding<EntityManager>) state[0];
+
+ }
+
+ public Object saveState(FacesContext context)
+ {
+ Object[] state = new Object[1];
+ state[0] = entityManager;
+ return state;
+ }
+
+ public void setTransient(boolean newTransientValue)
+ {
+ this._transient = newTransientValue;
+ }*/
}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list