|
From: <tri...@us...> - 2008-12-17 09:40:03
|
Revision: 914
http://equanda.svn.sourceforge.net/equanda/?rev=914&view=rev
Author: triathlon98
Date: 2008-12-17 09:39:57 +0000 (Wed, 17 Dec 2008)
Log Message:
-----------
EQ-300 changes in exception
Modified Paths:
--------------
trunk/equanda-client/src/main/java/org/equanda/client/EquandaUserInfo.java
trunk/equanda-client/src/main/java/org/equanda/client/LoginInfo.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaEJB.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaImportProxy.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaMediatorRoot.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceException.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaProxy.java
trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaSelector.java
trunk/equanda-client/src/main/java/org/equanda/persistence/LazyEJBListBase.java
trunk/equanda-client/src/main/java/org/equanda/persistence/LazyList.java
trunk/equanda-client/src/main/java/org/equanda/persistence/LazyProxyListBase.java
trunk/equanda-client/src/main/resources/org/equanda/translations/translations-common.txt
trunk/equanda-client/src/test/java/org/equanda/persistence/EquandaListTest.java
trunk/equanda-generate/src/main/velocity/docs/ProxyInterface.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/DMObjectBean.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/Mediator.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/MediatorRoot.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectBase.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectBean.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectEJBLocal.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ObjectSelectorHelperBase.java.vm
trunk/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
trunk/equanda-generate/src/main/velocity/login/LoginCache.java.vm
trunk/equanda-generate/src/main/velocity/login/LoginModule.java.vm
trunk/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm
trunk/equanda-generate/src/main/velocity/login/bean/LoginEJBLocal.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/base/EditPageBase.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/base/OneObjectComponentBase.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkList.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkOne.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/InlinePrimitiveList.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Action.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/ActionRes.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/GlobalAuthConfig.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/SelectAuthConfig.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/TableAuthConfig.java.vm
trunk/equanda-maven-plugin/src/main/resources/archetype-resources/core/src/main/java/OrganizationMediator.java
trunk/equanda-maven-plugin/src/main/resources/archetype-resources/core/src/main/java/UserMediator.java
trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/components/Layout.java
trunk/equanda-server/src/main/java/org/equanda/cache/EquandaCache.java
trunk/equanda-server/src/main/java/org/equanda/validation/Default.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/ActionMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/AutoFieldsMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/BuilderSetSelectorHelper.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/DefaultMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/EquandaRoleMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/LinkableMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/PriorityFieldsMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/ProgrConstraintsMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/SecurMediator.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/SecurSelectorHelper.java
trunk/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/VeryDocumentedSelectorHelper.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/export/ExportTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ChoicesTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CompareTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/DefaultTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/EmbeddedTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/EquandaQueryTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/MultipleFieldTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/RemoveLinksTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/RemoveTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/RequiredFieldsTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SetEquandaRollbackTest.java
trunk/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java
Added Paths:
-----------
trunk/equanda-client/src/main/java/org/equanda/client/EquandaException.java
trunk/equanda-client/src/main/java/org/equanda/client/ExceptionCodes.java
Removed Paths:
-------------
trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java
Added: trunk/equanda-client/src/main/java/org/equanda/client/EquandaException.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/client/EquandaException.java (rev 0)
+++ trunk/equanda-client/src/main/java/org/equanda/client/EquandaException.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -0,0 +1,202 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.client;
+
+import org.equanda.translations.TranslatorEJB;
+import org.equanda.translations.TranslatorEJBUtil;
+
+import javax.ejb.ApplicationException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Exception indicating a problem in the use of the equanda.
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ * @author NetRom team
+ */
+@ApplicationException( rollback = true )
+public class EquandaException
+ extends Exception
+{
+ public static final String CORE_EXCEPTIONS_CONTEXT = "equanda-exceptions";
+ public static final String APPLICATION_EXCEPTIONS_CONTEXT = "app-exceptions";
+ public static final String DEFAULT_MESSAGE = "EXCEPTION";
+ private static final long serialVersionUID = 6523420918533106344L;
+ private int exceptionCode;
+ private String appendedParameters;
+ private String[] injectedParameters;
+ private static final List<String> CONTEXTS = new ArrayList<String>();
+
+ static
+ {
+ CONTEXTS.add( CORE_EXCEPTIONS_CONTEXT );
+ CONTEXTS.add( APPLICATION_EXCEPTIONS_CONTEXT );
+ }
+
+ public EquandaException()
+ {
+ }
+
+ public EquandaException( Exception ex )
+ {
+ super( ex );
+ }
+
+ public EquandaException( int exceptionCode, Exception ex, String... parameters )
+ {
+ super( ex );
+ this.exceptionCode = exceptionCode;
+ setParams( parameters );
+
+ }
+
+ public EquandaException( int exceptionCode, Exception ex )
+ {
+ super( ex );
+ this.exceptionCode = exceptionCode;
+ }
+
+ public EquandaException( int exceptionCode, String... parameters )
+ {
+ this.exceptionCode = exceptionCode;
+ setParams( parameters );
+ }
+
+ /**
+ * Checks to see if the parameters are supposed to replace some $, $$ in the message, or they will just be
+ * appended at the end
+ *
+ * @param parameters parameters
+ */
+ private void setParams( String... parameters )
+ {
+ String translatedCode = translateCode();
+ if ( translatedCode != null )
+ {
+ if ( translatedCode.contains( "$" ) )
+ {
+ injectedParameters = parameters;
+ }
+ else
+ {
+ if ( parameters != null && parameters.length > 0 )
+ {
+ this.appendedParameters = parameters[ 0 ];
+ }
+ }
+ }
+ }
+
+ public String[] getInjectedParameters()
+ {
+ return injectedParameters;
+ }
+
+ public EquandaException( int exceptionCode )
+ {
+ this.exceptionCode = exceptionCode;
+ }
+
+ private String translateMessage( String message )
+ {
+ try
+ {
+ TranslatorEJB translator = TranslatorEJBUtil.get();
+ return translator.translate( "en", message, CONTEXTS );
+ }
+ catch ( Exception ex ) { return message; }
+ }
+
+ private String translateCode()
+ {
+ return translateMessage( Integer.toString( exceptionCode ) );
+ }
+
+ String getDefaultMessage()
+ {
+ return DEFAULT_MESSAGE;
+ }
+
+ public String getMessage()
+ {
+ if ( getCause() != null )
+ {
+ return getShortMessage() + ", root cause " + getCause().getMessage();
+ }
+ else
+ {
+ return getShortMessage();
+ }
+ }
+
+ public String getShortMessage()
+ {
+ String message;
+ message = translateCode();
+ if ( message != null && injectedParameters != null && injectedParameters.length > 0 )
+ {
+ for ( int i = 0; i < injectedParameters.length ; i++ )
+ {
+ String needTranslationParam = "$$" + ( i + 1 );
+ if ( message.contains( needTranslationParam ) )
+ {
+ String translation = translateMessage( injectedParameters[ i ] );
+ if ( translation != null )
+ {
+ message = message.replace( needTranslationParam, translation );
+ }
+ else
+ {
+ message = message.replace( needTranslationParam, injectedParameters[ i ] );
+ }
+ }
+ String verbatimParam = "$" + ( i + 1 );
+ if ( message.contains( verbatimParam ) )
+ {
+ String rs = injectedParameters[ i ];
+ if ( rs == null ) rs = "[null]";
+ message = message.replace( verbatimParam, rs );
+ }
+ }
+ }
+ if ( message == null ) message = getDefaultMessage() + ' ' + exceptionCode;
+ if ( getAppendedParameters() != null )
+ {
+ message += " (" + getAppendedParameters() + ')';
+ }
+ return message;
+ }
+
+ public int getExceptionCode()
+ {
+ return exceptionCode;
+ }
+
+ public String getAppendedParameters()
+ {
+ return appendedParameters;
+ }
+}
Modified: trunk/equanda-client/src/main/java/org/equanda/client/EquandaUserInfo.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/client/EquandaUserInfo.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/client/EquandaUserInfo.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -24,7 +24,6 @@
package org.equanda.client;
-import org.equanda.persistence.EquandaPersistenceException;
import java.sql.Timestamp;
/**
@@ -41,21 +40,21 @@
Timestamp getEquandaCreationDate();
String getUserName()
- throws EquandaPersistenceException;
+ throws EquandaException;
String getFirstName()
- throws EquandaPersistenceException;
+ throws EquandaException;
String getName()
- throws EquandaPersistenceException;
+ throws EquandaException;
String getPassword()
- throws EquandaPersistenceException;
+ throws EquandaException;
String getLanguage()
- throws EquandaPersistenceException;
+ throws EquandaException;
String getAuthAndConfig()
- throws EquandaPersistenceException;
+ throws EquandaException;
}
Copied: trunk/equanda-client/src/main/java/org/equanda/client/ExceptionCodes.java (from rev 911, trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java)
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/client/ExceptionCodes.java (rev 0)
+++ trunk/equanda-client/src/main/java/org/equanda/client/ExceptionCodes.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -0,0 +1,68 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.client;
+
+/**
+ * Codes for EquandaPersistence exceptions, used for internationalization
+ *
+ * @author NetRom team
+ */
+public interface ExceptionCodes
+{
+ int EE_OBJECT_NOT_FOUND = 90000;
+ int EE_FAILED_TO_UPDATE_VALUE = 90001;
+ int EE_CANNOT_CREATE_LAZYCOLLECTION = 90002;
+ int EE_FAILED_PROXY_REMOVE = 90003;
+ int EE_CANNOT_INIT_BEAN = 90004;
+
+ int EPE_PERSISTENCE_EXCEPTION = 94000;
+ int EPE_NULL_UOID_INVALID = 94001;
+ int EPE_UOID_NOT_FOUND = 94002;
+
+ int ECV_COULD_NOT_TEST_CHOICES_USING_CLASS = 91001;
+ int ECV_VALUE_IS_NOT_ONE_OF_THE_CHOICES = 91002;
+ int ECV_COMPARE_CONSTRAINT_NOT_SATISFIED = 91003;
+ int ECV_IMMUTABLE_IF_OTHER_FIELD_IS_SET = 91004;
+ int ECV_CANNOT_ADD_NULL_TO_MULTIPLE_FIELD = 91005;
+ int ECV_FIELD_IS_REQUIRED = 91006;
+ int ECV_FIELD_IS_UNIQUE = 91007;
+ int ECV_INCLUDE_VALUE_HAS_WRONG_TYPE = 91008;
+ int ECV_FAILED_TO_CREATE_INCLUDED_VALUE = 91009;
+ int ECV_INTERNAL_ERROR_ON_CREATE_INCLUDED_VALUE = 91010;
+ int ECV_CONSTRAINT_VIOLATION = 91011;
+ int ECV_FAILED_TO_UPDATE_VALUE = 91012;
+ int ECV_DOWNCAST_FAILED_CANNOT_DOWNCAST_ROOT = 91013;
+ int ECV_DOWNCAST_SELECTOR_ERROR = 91014;
+ int ECV_DOWNCAST_CREATE_ERROR = 91015;
+ int ECV_INVALID_TABLE_TYPE = 91016;
+ int ECV_OTHERSIDE_EMBEDDED_FIELD_IMMUTABLE_ONCE_SET = 91017;
+ int ECV_COMPARE_TYPE_CONSTRAINT_NOT_SATISFIED = 91018;
+ int ECV_CASCADE_KEEP = 90019;
+
+ int CME_DATA_HAS_BEEN_ALREADY_CHANGED = 92001;
+
+ int UONA_OPERATION_NOT_ALLOWED = 93001;
+
+}
Modified: trunk/equanda-client/src/main/java/org/equanda/client/LoginInfo.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/client/LoginInfo.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/client/LoginInfo.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -25,7 +25,6 @@
package org.equanda.client;
import org.apache.log4j.Logger;
-import org.equanda.persistence.EquandaPersistenceException;
import java.util.List;
@@ -65,7 +64,7 @@
this.userName = user.getUserName();
this.password = user.getPassword();
}
- catch ( EquandaPersistenceException epe )
+ catch ( EquandaException epe )
{
log.error( epe, epe );
}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaEJB.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaEJB.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaEJB.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -24,6 +24,8 @@
package org.equanda.persistence;
+import org.equanda.client.EquandaException;
+
/**
* Base interface for both local and remote EJB interfaces (for ObjectBase which is a shared interface for both).
*
@@ -33,18 +35,24 @@
extends HasId<ID>
{
void init( ID id )
- throws EquandaPersistenceException;
+ throws EquandaException;
+
void initEntity( EquandaEntity entity )
- throws EquandaPersistenceException;
+ throws EquandaException;
// equanda built-in methods
java.sql.Timestamp getEquandaModificationDate();
+
String getEquandaType();
+
boolean isEquandaType( String type );
+
String getEquandaName();
+
String getEquandaStatus();
+
void setEquandaStatus( String status );
-
- void remove();
+
+ void remove();
}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaImportProxy.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaImportProxy.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaImportProxy.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -24,6 +24,8 @@
package org.equanda.persistence;
+import org.equanda.client.EquandaException;
+
/**
* Some extra mathods which are available in all importproxy objects
*
@@ -62,13 +64,13 @@
boolean isModified();
void equandaUpdate()
- throws EquandaPersistenceException;
+ throws EquandaException;
void equandaUpdate( boolean updateTypeFieldsOnly )
- throws EquandaPersistenceException;
+ throws EquandaException;
void removeEntityBean()
- throws EquandaPersistenceException;
+ throws EquandaException;
void setEquandaUpdate( boolean update );
}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaMediatorRoot.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaMediatorRoot.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaMediatorRoot.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -24,6 +24,9 @@
package org.equanda.persistence;
+import org.equanda.client.EquandaException;
+import org.equanda.client.ExceptionCodes;
+
import javax.persistence.EntityManager;
/**
@@ -77,7 +80,7 @@
// fill in base (default) values when creating
public void create()
- throws EquandaPersistenceException
+ throws EquandaException
{}
// allow retrieval of the base entity information
@@ -88,7 +91,7 @@
public abstract ObjectType getEquandaTypeObject();
protected void checkImmutableIf( String field, String exclude )
- throws EquandaPersistenceException
+ throws EquandaException
{
// to be overwritten if needed
}
@@ -108,10 +111,10 @@
/**
* utility routine to allow checking the integrity of the record
*
- * @throws EquandaPersistenceException when constraints are violated
+ * @throws EquandaException when constraints are violated
*/
public void equandaCheckRules()
- throws EquandaPersistenceException
+ throws EquandaException
{
// to be overwritten if needed
}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceException.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceException.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaPersistenceException.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -24,12 +24,9 @@
package org.equanda.persistence;
-import org.equanda.translations.TranslatorEJB;
-import org.equanda.translations.TranslatorEJBUtil;
+import org.equanda.client.EquandaException;
import javax.ejb.ApplicationException;
-import java.util.ArrayList;
-import java.util.List;
/**
* Exception indicating a problem in the use of the equanda generated persistence layer.
@@ -39,23 +36,11 @@
*/
@ApplicationException( rollback = true )
public class EquandaPersistenceException
- extends Exception
+ extends EquandaException
{
- public static final String CORE_EXCEPTIONS_CONTEXT = "equanda-exceptions";
- public static final String APPLICATION_EXCEPTIONS_CONTEXT = "app-exceptions";
public static final String DEFAULT_MESSAGE = "PERSISTENCE EXCEPTION";
private static final long serialVersionUID = 6523420918533103446L;
- private int exceptionCode;
- private String appendedParameters;
- private String[] injectedParameters;
- private static final List<String> CONTEXTS = new ArrayList<String>();
- static
- {
- CONTEXTS.add( CORE_EXCEPTIONS_CONTEXT );
- CONTEXTS.add( APPLICATION_EXCEPTIONS_CONTEXT );
- }
-
public EquandaPersistenceException()
{
}
@@ -67,136 +52,26 @@
public EquandaPersistenceException( int exceptionCode, Exception ex, String... parameters )
{
- super( ex );
- this.exceptionCode = exceptionCode;
- setParams( parameters );
-
+ super( exceptionCode, ex, parameters );
}
public EquandaPersistenceException( int exceptionCode, Exception ex )
{
- super( ex );
- this.exceptionCode = exceptionCode;
+ super( exceptionCode, ex );
}
public EquandaPersistenceException( int exceptionCode, String... parameters )
{
- this.exceptionCode = exceptionCode;
- setParams( parameters );
+ super( exceptionCode, parameters );
}
- /**
- * Checks to see if the parameters are supposed to replace some $, $$ in the message, or they will just be
- * appended at the end
- *
- * @param parameters parameters
- */
- private void setParams( String... parameters )
- {
- String translatedCode = translateCode();
- if ( translatedCode != null )
- {
- if ( translatedCode.contains( "$" ) )
- {
- injectedParameters = parameters;
- }
- else
- {
- if ( parameters != null && parameters.length > 0 )
- {
- this.appendedParameters = parameters[ 0 ];
- }
- }
- }
- }
-
- public String[] getInjectedParameters()
- {
- return injectedParameters;
- }
-
public EquandaPersistenceException( int exceptionCode )
{
- this.exceptionCode = exceptionCode;
+ super( exceptionCode );
}
- private String translateMessage( String message )
- {
- try
- {
- TranslatorEJB translator = TranslatorEJBUtil.get();
- return translator.translate( "en", message, CONTEXTS );
- }
- catch ( Exception ex ) { return message; }
- }
-
- private String translateCode()
- {
- return translateMessage( Integer.toString( exceptionCode ) );
- }
-
String getDefaultMessage()
{
return DEFAULT_MESSAGE;
}
-
- public String getMessage()
- {
- if ( getCause() != null )
- {
- return getShortMessage() + ", root cause " + getCause().getMessage();
- }
- else
- {
- return getShortMessage();
- }
- }
-
- public String getShortMessage()
- {
- String message;
- message = translateCode();
- if ( message != null && injectedParameters != null && injectedParameters.length > 0 )
- {
- for ( int i = 0; i < injectedParameters.length ; i++ )
- {
- String needTranslationParam = "$$" + ( i + 1 );
- if ( message.contains( needTranslationParam ) )
- {
- String translation = translateMessage( injectedParameters[ i ] );
- if ( translation != null )
- {
- message = message.replace( needTranslationParam, translation );
- }
- else
- {
- message = message.replace( needTranslationParam, injectedParameters[ i ] );
- }
- }
- String verbatimParam = "$" + ( i + 1 );
- if ( message.contains( verbatimParam ) )
- {
- String rs = injectedParameters[ i ];
- if ( rs == null ) rs = "[null]";
- message = message.replace( verbatimParam, rs );
- }
- }
- }
- if ( message == null ) message = getDefaultMessage() + ' ' + exceptionCode;
- if ( getAppendedParameters() != null )
- {
- message += " (" + getAppendedParameters() + ')';
- }
- return message;
- }
-
- public int getExceptionCode()
- {
- return exceptionCode;
- }
-
- public String getAppendedParameters()
- {
- return appendedParameters;
- }
}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaProxy.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaProxy.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaProxy.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -25,10 +25,12 @@
package org.equanda.persistence;
import javolution.lang.TextBuilder;
+import org.equanda.client.EquandaException;
+import org.equanda.client.ExceptionCodes;
import java.io.Serializable;
+import java.lang.reflect.Method;
import java.sql.Timestamp;
-import java.lang.reflect.Method;
/**
* Base class for proxies.
@@ -144,30 +146,30 @@
/**
* Update the proxy state, client changes are persisted, and server changes retrieved.
- * @throws EquandaPersistenceException update problems
+ * @throws EquandaException update problems
*/
public void equandaUpdate()
- throws EquandaPersistenceException
+ throws EquandaException
{
equandaUpdate( false );
}
public abstract void equandaUpdate( boolean updateTypeFieldsOnly )
- throws EquandaPersistenceException;
+ throws EquandaException;
/**
* Reset the proxy state. If the proxy was not modified, nothing happens, otherwise the state is retrieved from the
* server again.
*
- * @throws EquandaPersistenceException oops
+ * @throws EquandaException oops
*/
public abstract void equandaReset()
- throws EquandaPersistenceException;
+ throws EquandaException;
public void removeEntityBean()
- throws EquandaPersistenceException
+ throws EquandaException
{
- throw new EquandaPersistenceException( ExceptionCodes.UONA_OPERATION_NOT_ALLOWED );
+ throw new EquandaException( ExceptionCodes.UONA_OPERATION_NOT_ALLOWED );
}
public void setEquandaUpdate( boolean update )
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaSelector.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaSelector.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/EquandaSelector.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -24,6 +24,7 @@
package org.equanda.persistence;
+import org.equanda.client.EquandaException;
import org.equanda.persistence.query.EquandaQuery;
import java.util.List;
@@ -39,53 +40,53 @@
String getEquandaName();
PROXY equandaCreate( String type )
- throws EquandaPersistenceException;
+ throws EquandaException;
PROXY selectId( ID id )
- throws EquandaPersistenceException;
+ throws EquandaException;
EJB selectIdEJB( ID id )
- throws EquandaPersistenceException;
+ throws EquandaException;
PROXY[] selectMultipleId( ID[] arr )
- throws EquandaPersistenceException;
+ throws EquandaException;
/*
* run query methods
*/
List<PROXY> selectEquanda( EquandaQuery query )
- throws EquandaPersistenceException;
+ throws EquandaException;
List<EJB> selectEquandaEJB( EquandaQuery query )
- throws EquandaPersistenceException;
+ throws EquandaException;
List<ID> equandaRunQueryId( EquandaQuery query )
- throws EquandaPersistenceException;
+ throws EquandaException;
List<PROXY> equandaRunQuery( EquandaQuery query )
- throws EquandaPersistenceException;
+ throws EquandaException;
List<EJB> equandaRunQueryEJB( EquandaQuery query )
- throws EquandaPersistenceException;
+ throws EquandaException;
long equandaRunCountQuery( EquandaQuery query )
- throws EquandaPersistenceException;
+ throws EquandaException;
long equandaRunUpdateQuery( EquandaQuery query )
- throws EquandaPersistenceException;
+ throws EquandaException;
PROXY selectEquandaSingle( EquandaQuery query )
- throws EquandaPersistenceException;
+ throws EquandaException;
EJB selectEquandaSingleEJB( EquandaQuery query )
- throws EquandaPersistenceException;
+ throws EquandaException;
PROXY equandaRefresh( ID id, long version )
- throws EquandaPersistenceException;
+ throws EquandaException;
PROXY equandaUpdate( PROXY proxy )
- throws EquandaPersistenceException;
+ throws EquandaException;
void remove();
}
Deleted: trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/ExceptionCodes.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -1,71 +0,0 @@
-/**
- * This file is part of the equanda project.
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
- * ANY KIND, either express or implied. See the License for the specific language governing rights and
- * limitations under the License.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- */
-
-package org.equanda.persistence;
-
-/**
- * Codes for EquandaPersistence exceptions, used for internationalization
- *
- * @author NetRom team
- */
-public interface ExceptionCodes
-{
- // @todo - some of these I can't find in ejb templates so they are either in use elsewhere, or they can be removed
- int UPE_PERSISTENCE_EXCEPTION = 90000;
- int UPE_CANNOT_CREATE_SESSION_FACADE = 90001;
- int UPE_OBJECT_NOT_FOUND = 90002;
- int UPE_FAILED_TO_UPDATE_VALUE = 90003;
- int UPE_TRYING_TO_UPDATE_OBJECT_WITH_UOID_NULL = 90004;
- int UPE_CANNOT_CREATE_LAZYCOLLECTION = 90005;
- int UPE_CASCADE_KEEP = 90006;
- int UPE_NULL_UOID_INVALID = 90007;
- int UPE_UOID_NOT_FOUND = 90008;
- int UPE_AUTO_FIELD_PROBLEM = 90009;
- int UPE_FAILED_PROXY_REMOVE = 90010;
- int UPE_CANNOT_INIT_BEAN = 90011;
-
- int ECV_COULD_NOT_TEST_CHOICES_USING_CLASS = 91001;
- int ECV_VALUE_IS_NOT_ONE_OF_THE_CHOICES = 91002;
- int ECV_COMPARE_CONSTRAINT_NOT_SATISFIED = 91003;
- int ECV_IMMUTABLE_IF_OTHER_FIELD_IS_SET = 91004;
- int ECV_CANNOT_ADD_NULL_TO_MULTIPLE_FIELD = 91005;
- int ECV_FIELD_IS_REQUIRED = 91006;
- int ECV_FIELD_IS_UNIQUE = 91007;
- int ECV_INCLUDE_VALUE_HAS_WRONG_TYPE = 91008;
- int ECV_FAILED_TO_CREATE_INCLUDED_VALUE = 91009;
- int ECV_INTERNAL_ERROR_ON_CREATE_INCLUDED_VALUE = 91010;
- int ECV_CONSTRAINT_VIOLATION = 91011;
- int ECV_FAILED_TO_UPDATE_VALUE = 91012;
- int ECV_DOWNCAST_FAILED_CANNOT_DOWNCAST_ROOT = 91013;
- int ECV_DOWNCAST_SELECTOR_ERROR = 91014;
- int ECV_DOWNCAST_CREATE_ERROR = 91015;
- int ECV_INVALID_TABLE_TYPE = 91016;
- int ECV_OTHERSIDE_EMBEDDED_FIELD_IMMUTABLE_ONCE_SET = 91017;
- int ECV_COMPARE_TYPE_CONSTRAINT_NOT_SATISFIED = 91018;
-
- int CME_DATA_HAS_BEEN_ALREADY_CHANGED = 92001;
-
- int UONA_OPERATION_NOT_ALLOWED = 93001;
-
-}
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/LazyEJBListBase.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/LazyEJBListBase.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/LazyEJBListBase.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -24,6 +24,7 @@
package org.equanda.persistence;
+import org.equanda.client.EquandaException;
import org.equanda.persistence.query.EquandaQuery;
import javax.naming.NamingException;
@@ -57,7 +58,7 @@
throws NamingException;
protected EJB getOneObject( ID id )
- throws NamingException, EquandaPersistenceException
+ throws NamingException, EquandaException
{
SEL sel = getSelector();
EJB res = sel.selectIdEJB( id );
@@ -66,7 +67,7 @@
}
protected EJB getOneObject( int index )
- throws NamingException, EquandaPersistenceException
+ throws NamingException, EquandaException
{
SelectorsStateType keepSelectorsState = SelectorsState.getSelectorsState();
try
@@ -91,13 +92,13 @@
}
protected EJB refreshObject( EJB obj )
- throws NamingException, EquandaPersistenceException
+ throws NamingException, EquandaException
{
return obj;
}
protected EJB[] getMultipleObjects( ID[] ids )
- throws NamingException, EquandaPersistenceException
+ throws NamingException, EquandaException
{
SEL sel = getSelector();
EJB[] res = (EJB[]) new EquandaEJB[ids.length];
@@ -107,7 +108,7 @@
}
protected EJB[] getMultipleObjects( int first, int size )
- throws NamingException, EquandaPersistenceException
+ throws NamingException, EquandaException
{
SelectorsStateType keepSelectorsState = SelectorsState.getSelectorsState();
try
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/LazyList.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/LazyList.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/LazyList.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -25,6 +25,8 @@
package org.equanda.persistence;
import org.apache.log4j.Logger;
+import org.equanda.client.EquandaException;
+import org.equanda.client.ExceptionCodes;
import org.equanda.persistence.query.EquandaQuery;
import org.equanda.util.MockObject;
@@ -89,10 +91,10 @@
* @param id pk
* @return object with given id
* @throws NamingException problems
- * @throws EquandaPersistenceException problems
+ * @throws EquandaException problems
*/
protected abstract TYPE getOneObject( ID id )
- throws NamingException, EquandaPersistenceException;
+ throws NamingException, EquandaException;
/**
* Get TYPE objects for the given ids
@@ -100,10 +102,10 @@
* @param ids pks
* @return objects with given ids
* @throws NamingException problems
- * @throws EquandaPersistenceException problems
+ * @throws EquandaException problems
*/
protected abstract TYPE[] getMultipleObjects( ID[] ids )
- throws NamingException, EquandaPersistenceException;
+ throws NamingException, EquandaException;
/**
* Refresh the given object to make sure the data is live (used when cache timeout expired)
@@ -111,21 +113,19 @@
* @param obj object to refresh
* @return fresh version of object
* @throws NamingException problems
- * @throws EquandaPersistenceException problems
+ * @throws EquandaException problems
*/
protected abstract TYPE refreshObject( TYPE obj )
- throws NamingException, EquandaPersistenceException;
+ throws NamingException, EquandaException;
// used when multiple subselects are used with ADD operator
protected abstract TYPE getOneObject( int index )
- throws NamingException, EquandaPersistenceException;
+ throws NamingException, EquandaException;
protected abstract TYPE[] getMultipleObjects( int first, int size )
- throws NamingException, EquandaPersistenceException;
+ throws NamingException, EquandaException;
- /**
- * make sure this thing works
- */
+ /** make sure this thing works */
private static final Logger log = Logger.getLogger( LazyList.class );
private MockObject mock;
@@ -214,7 +214,7 @@
}
private TYPE getFromCache( int index )
- throws NamingException, EquandaPersistenceException
+ throws NamingException, EquandaException
{
if ( getCacheCapacity() <= 1 || data != null )
{
@@ -276,7 +276,7 @@
if ( cache.length > 0 )
{
if ( nextObj != null && ( index == previousEndOfCache )
- && !nextObj.equals( cache[ 0 ].getId() ) )
+ && !nextObj.equals( cache[ 0 ].getId() ) )
{
throw new ConcurrentModificationException();
}
@@ -418,7 +418,7 @@
val = sel.equandaRunQueryEJB( query );
if ( val == null )
{
- throw new EquandaPersistenceException( UPE_CANNOT_CREATE_LAZYCOLLECTION );
+ throw new EquandaException( EE_CANNOT_CREATE_LAZYCOLLECTION );
}
for ( TYPE o : val )
{
@@ -440,18 +440,14 @@
}
}
- /**
- * @deprecated
- */
+ /** @deprecated */
public int size()
{
long size = fullSize();
return ( size > Integer.MAX_VALUE ) ? Integer.MAX_VALUE : (int) size;
}
- /**
- * make List object complete
- */
+ /** make List object complete */
public boolean isEmpty()
{
@@ -560,9 +556,7 @@
throw new UnsupportedOperationException( "subList(int,int) unsupported" );
}
- /**
- * refresh list, force release cache
- */
+ /** refresh list, force release cache */
public void refresh()
{
timeCache = 0;
Modified: trunk/equanda-client/src/main/java/org/equanda/persistence/LazyProxyListBase.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/persistence/LazyProxyListBase.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/java/org/equanda/persistence/LazyProxyListBase.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -24,6 +24,7 @@
package org.equanda.persistence;
+import org.equanda.client.EquandaException;
import org.equanda.persistence.query.EquandaQuery;
import javax.naming.NamingException;
@@ -57,7 +58,7 @@
throws NamingException;
protected PROXY getOneObject( ID id )
- throws NamingException, EquandaPersistenceException
+ throws NamingException, EquandaException
{
SEL sel = getSelector();
PROXY res = sel.selectId( id );
@@ -66,7 +67,7 @@
}
protected PROXY getOneObject( int index )
- throws NamingException, EquandaPersistenceException
+ throws NamingException, EquandaException
{
SelectorsStateType keepSelectorsState = SelectorsState.getSelectorsState();
try
@@ -91,14 +92,14 @@
}
protected PROXY refreshObject( PROXY obj )
- throws NamingException, EquandaPersistenceException
+ throws NamingException, EquandaException
{
obj.equandaUpdate();
return obj;
}
protected PROXY[] getMultipleObjects( ID[] ids )
- throws NamingException, EquandaPersistenceException
+ throws NamingException, EquandaException
{
SEL sel = getSelector();
PROXY[] res = sel.selectMultipleId( ids );
@@ -107,7 +108,7 @@
}
protected PROXY[] getMultipleObjects( int first, int size )
- throws NamingException, EquandaPersistenceException
+ throws NamingException, EquandaException
{
SelectorsStateType keepSelectorsState = SelectorsState.getSelectorsState();
try
Modified: trunk/equanda-client/src/main/resources/org/equanda/translations/translations-common.txt
===================================================================
--- trunk/equanda-client/src/main/resources/org/equanda/translations/translations-common.txt 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/main/resources/org/equanda/translations/translations-common.txt 2008-12-17 09:39:57 UTC (rev 914)
@@ -1,61 +1,26 @@
;Last edited: 2007-06-03
.languages en;nl;ro;fr
.key 90000/equanda-exceptions
-.label.en Persistence exception
-.label.nl Persistence probleem
-.label.ro Exceptie de persistenta
-.label.fr Problème de persistance
-.key 90001/equanda-exceptions
-.label.en Can't create session facade
-.label.nl Kan sessie façade niet aanmaken
-.label.ro Nu se poate crea obiectul
-.label.fr Peut pas creér façade de session
-.key 90002/equanda-exceptions
.label.en Object not found
.label.nl Object niet gevonden
.label.ro Obiectul nu a fost gasit
.label.fr Objet non trouvé
-.key 90003/equanda-exceptions
+.key 90001/equanda-exceptions
.label.en Failed to update value
.label.nl Update van waarde is mislukt
.label.ro Valuarea nu a fost modificata
.label.fr Rafraishir valeur non reusit
-.key 90004/equanda-exceptions
-.label.en Trying to update object with UOID==null
-.label.nl Poging tot update object met uoid null
-.label.ro Incercare de a modifica un obiect care are UOID-ul null
-.label.fr Essai de rafraishir un objet avec uoid null
-.key 90005/equanda-exceptions
+.key 90002/equanda-exceptions
.label.en Can't create lazycollection
.label.nl Kan collectie niet aanmaken
.label.ro Nu se poate crea colectia intermediara
.label.fr Creation collection non reusit
-.key 90006/equanda-exceptions
-.label.en Cannot delete as there are references to this record
-.label.nl Kan gegevens niet verwijderen aangezien er nog verwijzingen naar bestaan
-.label.ro Verificare esuata pt Cascade-keep
-.label.fr Données ne peuvent pas être effacé si il-y a encore des références active
-.key 90007/equanda-exceptions
-.label.en Null UOID is not allowed
-.label.nl UOID is null
-.label.ro UOID-ul nu are voie sa fie gol sau null
-.label.fr UOID est null
-.key 90008/equanda-exceptions
-.label.en UOID $1 not found for an object of type $2
-.label.nl UOID $1 niet gevonden voor $2 object
-.label.ro UOID-ul $1 nu a fost gasit pentru un obiect de tipul $2
-.label.fr UOID $1 non trouvé pour un objet $2
-.key 90009/equanda-exceptions
-.label.en Cannot set auto field $$1
-.label.nl Kan auto veld $$2 niet zetten
-.label.ro Nu se poate seta un camp auto $$1
-.label.fr Problème avec champs automatique $$2
-.key 90010/equanda-exceptions
+.key 90003/equanda-exceptions
.label.en Cannot remove proxy when not saved
.label.nl Kan proxy niet verwijderen als niet opgeslagen
.label.ro Nu se poate sterge un proxy care nu a fost salvat
.label.fr Proxy non-sauvegardé ne peut pas être effacé
-.key 90011/equanda-exceptions
+.key 90004/equanda-exceptions
.label.en Cannot initialize bean
.label.nl Kan bean niet initializeren
.label.ro Bean-ul nu se poate initializa
@@ -140,6 +105,14 @@
.label.nl Ongeldig tabel type$$1 voor tabel $$2
.label.ro Tipul de tabla este invalid $$1 pentru tabela $$2
.label.fr Type de table $$1 non-valable pour table $$2
+.key 910018/equanda-exceptions
+.label.en Compare type constraint not satisfied
+.label.nl compare constraint niet voldaan
+.key 910019/equanda-exceptions
+.label.en Cannot delete as there are references to this record
+.label.nl Kan gegevens niet verwijderen aangezien er nog verwijzingen naar bestaan
+.label.ro Verificare esuata pt Cascade-keep
+.label.fr Données ne peuvent pas être effacé si il-y a encore des références active
.key 92001/equanda-exceptions
.label.en Data has already changed
.label.nl Data is reeds gewijzigd
@@ -150,6 +123,21 @@
.label.nl Operatie niet toegestaan
.label.ro Operatia nu este permisa
.label.fr Opération n'est pas permie
+.key 94000/equanda-exceptions
+.label.en Persistence exception
+.label.nl Persistence probleem
+.label.ro Exceptie de persistenta
+.label.fr Problème de persistance
+.key 94001/equanda-exceptions
+.label.en Null UOID is not allowed
+.label.nl UOID is null
+.label.ro UOID-ul nu are voie sa fie gol sau null
+.label.fr UOID est null
+.key 90002/equanda-exceptions
+.label.en UOID $1 not found for an object of type $2
+.label.nl UOID $1 niet gevonden voor $2 object
+.label.ro UOID-ul $1 nu a fost gasit pentru un obiect de tipul $2
+.label.fr UOID $1 non trouvé pour un objet $2
.key Action/equanda-fixed
.label.en Action
.label.nl Actie
Modified: trunk/equanda-client/src/test/java/org/equanda/persistence/EquandaListTest.java
===================================================================
--- trunk/equanda-client/src/test/java/org/equanda/persistence/EquandaListTest.java 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-client/src/test/java/org/equanda/persistence/EquandaListTest.java 2008-12-17 09:39:57 UTC (rev 914)
@@ -1,6 +1,7 @@
package org.equanda.persistence;
import junit.framework.TestCase;
+import org.equanda.client.EquandaException;
import java.util.ArrayList;
import java.util.Collection;
@@ -275,11 +276,11 @@
public DummyProxy equandaClone( boolean cloneUoid ) { return null; }
public void equandaUpdate()
- throws EquandaPersistenceException
+ throws EquandaException
{}
public void equandaUpdate( boolean updateTypeFieldsOnly )
- throws EquandaPersistenceException
+ throws EquandaException
{}
public String getEquandaStatus() { return null; }
@@ -293,7 +294,7 @@
public boolean isModified( boolean type ) { return false; }
public void equandaReset()
- throws EquandaPersistenceException
+ throws EquandaException
{/*nothing to do, just assure this can be compiled*/}
public String getDistinct()
Modified: trunk/equanda-generate/src/main/velocity/docs/ProxyInterface.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/docs/ProxyInterface.java.vm 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-generate/src/main/velocity/docs/ProxyInterface.java.vm 2008-12-17 09:39:57 UTC (rev 914)
@@ -33,12 +33,12 @@
package ${package}.client;
+import org.equanda.client.EquandaException;
import org.equanda.persistence.Uoid;
import org.equanda.persistence.ObjectType;
import org.equanda.persistence.EquandaList;
import org.equanda.persistence.EquandaProxy;
-import org.equanda.persistence.EquandaPersistenceException;
-import org.equanda.persistence.ExceptionCodes;
+import org.equanda.client.ExceptionCodes;
import java.util.Arrays;
import java.util.Collection;
@@ -82,7 +82,7 @@
* $field.Description
*/
public $fieldtype get${field.Name}()
- throws EquandaPersistenceException;
+ throws EquandaException;
#if( $field.isBoolean() )
/**
@@ -106,24 +106,24 @@
* $action.Description
*/
public $action.Return ${action.Name}( $action.ParametersListWithTypes )
- throws EquandaPersistenceException;
+ throws EquandaException;
#end
public void equandaUpdate( boolean updateTypeFieldsOnly )
- throws EquandaPersistenceException;
+ throws EquandaException;
/**
* Reset the proxy state. If the proxy was not modified, nothing happens, otherwise the state is retrieved from the
* server again.
*
- * @throws EquandaPersistenceException oops
+ * @throws EquandaException oops
*/
public void equandaReset()
- throws EquandaPersistenceException;
+ throws EquandaException;
#if( $table.hasSecurityRoleRemove() )
public void removeEntityBean()
- throws EquandaPersistenceException;
+ throws EquandaException;
#end
}
Modified: trunk/equanda-generate/src/main/velocity/ejb3/DMObjectBean.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/DMObjectBean.java.vm 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-generate/src/main/velocity/ejb3/DMObjectBean.java.vm 2008-12-17 09:39:57 UTC (rev 914)
@@ -31,10 +31,10 @@
package ${package}.server.pm;
+import org.equanda.client.EquandaException;
import org.equanda.persistence.Uoid;
import org.equanda.persistence.UoidGenerator;
import org.equanda.persistence.EquandaEntity;
-import org.equanda.persistence.EquandaPersistenceException;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.CacheConcurrencyStrategy;
@@ -187,7 +187,7 @@
#end
public DM${table.Name}Bean(String type #foreach( $field in $table.ImmutableFields ), $field.JavaFieldType ${field.VarName}#end )
- throws EquandaPersistenceException
+ throws EquandaException
{
// initialise all CMP fields
#foreach( $field in $table.FieldsNotImmutableAndNotCalculated )
@@ -242,7 +242,7 @@
setEquandaStatus( "M" );
}
- protected DM${table.Name}Bean() throws EquandaPersistenceException {}
+ protected DM${table.Name}Bean() throws EquandaException {}
#foreach( $ck in $table.CascadeKeepNotBidirectional )
// CascadeKeep bidi $ck.isBidirectional() $ck.Name $ck.FieldName $ck.LinkedTableName
Modified: trunk/equanda-generate/src/main/velocity/ejb3/Mediator.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/Mediator.java.vm 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-generate/src/main/velocity/ejb3/Mediator.java.vm 2008-12-17 09:39:57 UTC (rev 914)
@@ -37,7 +37,7 @@
package ${package}.server;
-import org.equanda.persistence.EquandaPersistenceException;
+import org.equanda.client.EquandaException;
import java.util.Collection;
import java.util.ArrayList;
@@ -51,7 +51,7 @@
#if( !$field.isMultiple() )
#if( $field.isAuto() && $root.Name == $table.Name )
- protected $fieldtype auto${field.Name}() throws EquandaPersistenceException {
+ protected $fieldtype auto${field.Name}() throws EquandaException {
// @todo implementation to be provided
#set( $value="0" )
#if( $field.isString() || $field.isDate() || $field.isTimestamp() || $field.isLink() ) #set( $value="null" )
@@ -73,7 +73,7 @@
#else
#if( $field.isAuto() && $root.Name == $table.Name )
- protected Collection auto${field.Name}() throws EquandaPersistenceException {
+ protected Collection auto${field.Name}() throws EquandaException {
// @todo implementation to be provided
return new ArrayList();
}
@@ -91,7 +91,7 @@
#set( $sep=", " )
#set( $cnt=$cnt+1 )
#end
- ) throws EquandaPersistenceException {
+ ) throws EquandaException {
// @todo implementation to be provided
#if( $action.Return!="void" )
return
Modified: trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase-set.java.vm 2008-12-17 09:39:57 UTC (rev 914)
@@ -32,7 +32,7 @@
#if( $field.isMultiple() )
#if( !$field.isLink() )
public void add${field.Singular}( $fieldtype value )
- throws EquandaPersistenceException
+ throws EquandaException
{
if ( value == null )
{
@@ -60,7 +60,7 @@
}
public void remove${field.Singular}( $fieldtype value )
- throws EquandaPersistenceException
+ throws EquandaException
{
#* check constraints *#
#parse("MediatorBase-mutable.java.vm")
@@ -81,7 +81,7 @@
}
#else ## is link
public void addEquandaLink${field.Singular}( Uoid value )
- throws EquandaPersistenceException
+ throws EquandaException
{
if ( value == null )
{
@@ -114,7 +114,7 @@
}
public void removeEquandaLink${field.Singular}( Uoid value )
- throws EquandaPersistenceException
+ throws EquandaException
{
#* check constraints *#
#parse("MediatorBase-mutable.java.vm")
@@ -155,7 +155,7 @@
#else ## is single
#if( !$field.isLink() )
public void set${field.Name}( $fieldtype $field.VarName )
- throws EquandaPersistenceException
+ throws EquandaException
{
#if( $field.Name == "Password" && $field.isString() )
if ( null == $field.VarName || "".equals( $field.VarName ) ) return;
@@ -221,7 +221,7 @@
#else ## is link
public void setEquandaLink${field.Name}( Uoid value )
- throws EquandaPersistenceException
+ throws EquandaException
{
#* do nothing if values are equals *#
if ( testEquals( getEquandaLink${field.Name}(), value ) ) return;
Modified: trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase.java.vm 2008-12-17 09:28:59 UTC (rev 913)
+++ trunk/equanda-generate/src/main/velocity/ejb3/MediatorBase.java.vm 2008-12-17 09:39:57 UTC (rev 914)
@@ -43,10 +43,10 @@
package ${package}.server;
import org.apache.log4j.Logger;
+import org.equanda.client.EquandaException;
import org.equanda.persistence.Uoid;
import org.equanda.persistence.ObjectType;
import org.equanda.persistence.EquandaConstraintViolation;
-import org.equanda.persistence.EquandaPersistenceException;
import ${package}.client.*;
import ${package}.server.pm.*;
@@ -59,7 +59,7 @@
#set( $parent="$!{table.ParentTable.Name}Mediator" )
#if( $parent=="Mediator" ) #set( $parent="${root.Name}MediatorRoot" ) #end
public abstract class ${table.Name}MediatorBase
- extends ${parent} implements org.equanda.persistence.ExceptionCodes
+ extends ${parent} implements org.equanda.client.ExceptionCodes
{
private static final Logger log = Logger.getLogger( ${table.Name}MediatorBase.class );
@@ -67,7 +67,7 @@
// fill in base (default) values when creating
public void create()
- throws EquandaPersistenceException
+ throws EquandaException
{
super.create();
// initialise auto fields - todo not sure if this is needed - it should have been done in ObjectBean.init
@@ -89,7 +89,7 @@
#parse("MediatorBase-set.java.vm")
protected void checkImmutableIf( String field, String exclude )
- throws EquandaPersistenceException
+ throws EquandaException
{
super.checkImmutableIf( field, exclude );
#if( $table.hasImmutableIf() )
@@ -110,7 +110,7 @@
* allow extra functionality when creating an object as a clone
*/
protected void equandaClone( DM${root.Name}Bean base )
- throws EquandaPersistenceException
+ throws EquandaException
{
#if( $table.Name != $table.Root.Name )super.equandaClone...
[truncated message content] |