[jboss-cvs] jboss-seam/ui/src/main/java/org/jboss/seam/ui/converter/entityConverter ...
Peter Muir
peter at bleepbleep.org.uk
Sun Jan 6 16:25:39 EST 2008
User: pmuir
Date: 08/01/06 16:25:39
Modified: ui/src/main/java/org/jboss/seam/ui/converter/entityConverter
AbstractEntityLoader.java
Log:
Better error message if SMPC/SMHS not configured
Revision Changes Path
1.3 +9 -1 jboss-seam/ui/src/main/java/org/jboss/seam/ui/converter/entityConverter/AbstractEntityLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AbstractEntityLoader.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/ui/src/main/java/org/jboss/seam/ui/converter/entityConverter/AbstractEntityLoader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- AbstractEntityLoader.java 6 Nov 2007 12:23:46 -0000 1.2
+++ AbstractEntityLoader.java 6 Jan 2008 21:25:39 -0000 1.3
@@ -20,6 +20,10 @@
@Transactional
public Object get(String key)
{
+ if (getPersistenceContext() == null)
+ {
+ throw new IllegalStateException("Unable to get a Persistence Context to load Entity. Make sure you have an SMPC called entityManager configured in components.xml (or have correctly configured s:convertEntity to use another SMPC).");
+ }
Identifier identifier = EntityIdentifierStore.instance().get(key);
if (identifier != null)
{
@@ -39,6 +43,10 @@
@Transactional
public String put(Object entity)
{
+ if (getPersistenceContext() == null)
+ {
+ throw new IllegalStateException("Unable to get a Persistence Context to store Entity. Make sure you have an SMPC called entityManager configured in components.xml (or have correctly configured s:convertEntity to use another SMPC).");
+ }
return EntityIdentifierStore.instance().put(createIdentifier(entity), entity);
}
More information about the jboss-cvs-commits
mailing list