You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(6) |
Aug
(41) |
Sep
(44) |
Oct
(31) |
Nov
(54) |
Dec
(53) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(71) |
Feb
(66) |
Mar
(65) |
Apr
(73) |
May
(68) |
Jun
(69) |
Jul
(28) |
Aug
(49) |
Sep
(44) |
Oct
(77) |
Nov
(64) |
Dec
(78) |
| 2009 |
Jan
(50) |
Feb
(28) |
Mar
(41) |
Apr
(30) |
May
(5) |
Jun
(30) |
Jul
(6) |
Aug
(2) |
Sep
(18) |
Oct
(11) |
Nov
(6) |
Dec
(10) |
| 2010 |
Jan
(5) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <tri...@us...> - 2009-04-17 13:28:37
|
Revision: 1084
http://equanda.svn.sourceforge.net/equanda/?rev=1084&view=rev
Author: triathlon98
Date: 2009-04-17 13:27:54 +0000 (Fri, 17 Apr 2009)
Log Message:
-----------
small fixes in archetype
Modified Paths:
--------------
trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/components/Layout.java
trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/pages/Start.java
Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/components/Layout.java
===================================================================
--- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/components/Layout.java 2009-04-17 09:23:03 UTC (rev 1083)
+++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/components/Layout.java 2009-04-17 13:27:54 UTC (rev 1084)
@@ -25,7 +25,7 @@
*
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
*/
-@IncludeJavaScriptLibrary( { "${tapestry.scriptaculous}/prototype.js",
+@IncludeJavaScriptLibrary( { "#literal()${tapestry.scriptaculous}#end/prototype.js",
"classpath:/org/equanda/tapestry5/resources/t5equanda.js",
"context:script/app.js",
"classpath:/org/chenillekit/tapestry/core/Chenillekit.js" } )
Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/pages/Start.java
===================================================================
--- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/pages/Start.java 2009-04-17 09:23:03 UTC (rev 1083)
+++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/gui/src/main/java/pages/Start.java 2009-04-17 13:27:54 UTC (rev 1084)
@@ -32,10 +32,10 @@
log.info( "Value for key Add-Continue from messages1 is: " + messages.get( "Add-Continue" ) );
}
- public Date getCurrentTime()
- {
- return new Date();
- }
+ public Date getCurrentTime()
+ {
+ return new Date();
+ }
public String[] getMessagesGroups()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-04-17 09:24:03
|
Revision: 1083
http://equanda.svn.sourceforge.net/equanda/?rev=1083&view=rev
Author: triathlon98
Date: 2009-04-17 09:23:03 +0000 (Fri, 17 Apr 2009)
Log Message:
-----------
EQ-338 remove StringTranslator
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/t5gui/base/OneObjectComponentBase.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkList.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/InlinePrimitiveList.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/choice.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/password.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/string.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/text.tml.vm
trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java
trunk/equanda-test/pom.xml
trunk/pom.xml
Removed Paths:
-------------
trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/StringTranslator.java
Modified: trunk/equanda-generate/src/main/velocity/t5gui/base/OneObjectComponentBase.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/base/OneObjectComponentBase.java.vm 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/equanda-generate/src/main/velocity/t5gui/base/OneObjectComponentBase.java.vm 2009-04-17 09:23:03 UTC (rev 1083)
@@ -46,7 +46,6 @@
import org.equanda.t5gui.services.EquandaMessages;
import org.equanda.tapestry5.base.EquandaOptionModel;
import org.equanda.tapestry5.base.EquandaSelectModel;
-import org.equanda.tapestry5.translators.StringTranslator;
import org.equanda.tapestry5.translators.TimestampTranslator;
import org.equanda.validation.EnumerableChoice;
import org.equanda.validation.ChoiceTranslation;
@@ -65,7 +64,6 @@
private static final Logger log = Logger.getLogger( OneObjectComponentBase.class );
private static final UoidTranslator ID_TRANSLATOR = new UoidTranslator();
private static final TimestampTranslator TIMESTAMP_TRANSLATOR = new TimestampTranslator();
- private static final StringTranslator STRING_TRANSLATOR = new StringTranslator();
private Object currentMultipleRow;
@@ -93,8 +91,6 @@
public Translator getTimestampTranslator() { return TIMESTAMP_TRANSLATOR; }
- public Translator getStringTranslator() { return STRING_TRANSLATOR; }
-
public boolean isTypeKnown() { return getValue().getId() != null; }
public ValueEncoder getTypeEncoder()
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkList.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkList.java.vm 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/InlineLinkList.java.vm 2009-04-17 09:23:03 UTC (rev 1083)
@@ -50,7 +50,6 @@
import org.apache.tapestry5.services.*;
import org.equanda.client.EquandaException;
import org.equanda.tapestry5.base.ObjectCreatorDelegate;
-import org.equanda.tapestry5.translators.StringTranslator;
import org.equanda.t5gui.SelectedSettings;
import org.equanda.persistence.Uoid;
@@ -66,7 +65,6 @@
implements ObjectCreatorDelegate<${table.Name}>
{
private static final Logger log = Logger.getLogger( InlineLinkList.class );
- private static final StringTranslator STRING_TRANSLATOR = new StringTranslator();
@Parameter( required = true, principal = true )
private List<${table.Name}> value;
@@ -74,7 +72,6 @@
@Inject
private Request request;
- //@Component( id = "hiddenDeletedRows", parameters = { "value=deletedRows", "translate=prop:stringTranslator" } )
@Component( id = "hiddenDeletedRows", parameters = { "value=deletedRows" } )
private TextField hiddenDeletedRows;
@@ -103,8 +100,6 @@
this.canAdd = canAdd;
}
- public Translator getStringTranslator() { return STRING_TRANSLATOR; }
-
static class FormSubmitAction
implements ComponentAction<InlineLinkList>
{
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/InlinePrimitiveList.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/InlinePrimitiveList.java.vm 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/InlinePrimitiveList.java.vm 2009-04-17 09:23:03 UTC (rev 1083)
@@ -48,7 +48,6 @@
import org.equanda.client.EquandaException;
import org.equanda.tapestry5.base.ObjectCreatorDelegate;
import org.equanda.tapestry5.components.JSPagedLoop;
-import org.equanda.tapestry5.translators.StringTranslator;
import org.equanda.t5gui.SelectedSettings;
import org.equanda.validation.*;
@@ -62,7 +61,6 @@
implements ObjectCreatorDelegate<Object>
{
private static final Logger log = Logger.getLogger( InlinePrimitiveList.class );
- private static final StringTranslator STRING_TRANSLATOR = new StringTranslator();
@Parameter( required = true, principal = true )
private List<Object> value;
@@ -100,7 +98,6 @@
@Inject
private Request request;
- //@Component( id = "hiddenDeletedRows", parameters = { "value=deletedRows", "translate=prop:stringTranslator" } )
@Component( id = "hiddenDeletedRows", parameters = { "value=deletedRows" } )
private TextField hiddenDeletedRows;
@@ -120,8 +117,6 @@
private String hiddenDeletedRowsId;
private int index;
- public Translator getStringTranslator() { return STRING_TRANSLATOR; }
-
static class FormSubmitAction
implements ComponentAction<InlinePrimitiveList>
{
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/choice.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/choice.tml.vm 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/choice.tml.vm 2009-04-17 09:23:03 UTC (rev 1083)
@@ -5,7 +5,7 @@
#* @vtlvariable name="field" type="org.equanda.domain.xml.Field" *#
#if( $field.isMultiple() )
#if( $field.isString() )
-<input t:type="InlinePrimitiveList" t:translator="prop:stringTranslator" t:value="value.${field.VarName}" embedded="${field.isEmbedded()}" #if( $field.isCalculated() || $field.isAuto() )disabled="true"#end #if( $field.isCaseConversionClass() ) caseConversionClass="$field.caseConversion.className" #end #if( $field.isCaseConversionUpper() ) caseConversionUpper="true" #elseif( $field.isCaseConversionLower() ) caseConversionLower="true" #end/> ## @todo temp hack
+<input t:type="InlinePrimitiveList" t:value="value.${field.VarName}" embedded="${field.isEmbedded()}" #if( $field.isCalculated() || $field.isAuto() )disabled="true"#end #if( $field.isCaseConversionClass() ) caseConversionClass="$field.caseConversion.className" #end #if( $field.isCaseConversionUpper() ) caseConversionUpper="true" #elseif( $field.isCaseConversionLower() ) caseConversionLower="true" #end/> ## @todo temp hack
#else
@todo ## @todo
#end
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/password.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/password.tml.vm 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/password.tml.vm 2009-04-17 09:23:03 UTC (rev 1083)
@@ -4,7 +4,7 @@
#* @vtlvariable name="table" type="org.equanda.domain.xml.transform.RootTable" *#
#* @vtlvariable name="field" type="org.equanda.domain.xml.Field" *#
#if( $field.isMultiple() )
-<input t:type="InlinePrimitiveList" t:passwordType="true" t:translator="prop:stringTranslator" t:value="value.${field.VarName}" embedded="${field.isEmbedded()}" #if( $field.isCalculated() || $field.isAuto() )disabled="true"#end/>
+<input t:type="InlinePrimitiveList" t:passwordType="true" t:value="value.${field.VarName}" embedded="${field.isEmbedded()}" #if( $field.isCalculated() || $field.isAuto() )disabled="true"#end/>
#else
<input t:type="PasswordField" t:value="value.${field.Name}" #if( $field.isCalculated() || $field.isAuto() )disabled="true"#end/>
#end
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/string.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/string.tml.vm 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/string.tml.vm 2009-04-17 09:23:03 UTC (rev 1083)
@@ -4,7 +4,7 @@
#* @vtlvariable name="table" type="org.equanda.domain.xml.transform.RootTable" *#
#* @vtlvariable name="field" type="org.equanda.domain.xml.Field" *#
#if( $field.isMultiple() )
-<input t:type="InlinePrimitiveList" t:translator="prop:stringTranslator" t:value="value.${field.VarName}" embedded="${field.isEmbedded()}" #if( $field.isCalculated() || $field.isAuto() )disabled="true"#end #if( $field.isCaseConversionClass() ) caseConversionClass="$field.caseConversion.className" #end #if( $field.isCaseConversionUpper() ) caseConversionUpper="true" #elseif( $field.isCaseConversionLower() ) caseConversionLower="true" #end/>
+<input t:type="InlinePrimitiveList" t:value="value.${field.VarName}" embedded="${field.isEmbedded()}" #if( $field.isCalculated() || $field.isAuto() )disabled="true"#end #if( $field.isCaseConversionClass() ) caseConversionClass="$field.caseConversion.className" #end #if( $field.isCaseConversionUpper() ) caseConversionUpper="true" #elseif( $field.isCaseConversionLower() ) caseConversionLower="true" #end/>
#else
<div class="in">
<input t:type="TextField" maxlength="$field.Length" size="$field.DisplayLength" #if( $field.isCaseConversionClass() ) t:value="${field.Name}Value" #else t:value="value.${field.Name}" #end #if( $field.isCalculated() || $field.isAuto() )disabled="true"#end #if( $field.hasCaseConversion() )onkeyup="eqCC(this, #if( $field.isCaseConversionUpper()) 2 #elseif( $field.isCaseConversionLower() ) 1 #else 0 #end);"#end #if( $field.isRequired() )t:validate="required"#end />
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/text.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/text.tml.vm 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/text.tml.vm 2009-04-17 09:23:03 UTC (rev 1083)
@@ -4,7 +4,7 @@
#* @vtlvariable name="table" type="org.equanda.domain.xml.transform.RootTable" *#
#* @vtlvariable name="field" type="org.equanda.domain.xml.Field" *#
#if( $field.isMultiple() )
-##<input t:type="InlinePrimitiveList" t:textType="true" t:translator="prop:stringTranslator" t:value="value.${field.Name}" embedded="${field.isEmbedded()}" #if( $field.isCalculated() || $field.isAuto() )disabled="true"#end #if( $field.isCaseConversionClass() ) caseConversionClass="$field.caseConversion.className" #end #if( $field.isCaseConversionUpper() ) caseConversionUpper="true" #elseif( $field.isCaseConversionLower() ) caseConversionLower="true" #end/>
+##<input t:type="InlinePrimitiveList" t:textType="true" t:value="value.${field.Name}" embedded="${field.isEmbedded()}" #if( $field.isCalculated() || $field.isAuto() )disabled="true"#end #if( $field.isCaseConversionClass() ) caseConversionClass="$field.caseConversion.className" #end #if( $field.isCaseConversionUpper() ) caseConversionUpper="true" #elseif( $field.isCaseConversionLower() ) caseConversionLower="true" #end/>
#else
<div class="in">
<textarea t:type="TextArea" rows="2" cols="40" t:value="value.${field.Name}" #if( $field.isCalculated() || $field.isAuto() )disabled="true"#end #if( $field.hasCaseConversion() )onkeyup="eqCC(this, #if( $field.isCaseConversionUpper()) 2 #elseif( $field.isCaseConversionLower() ) 1 #else 0 #end);"#end/>
Modified: trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml
===================================================================
--- trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/equanda-maven-plugin/src/main/resources/archetype-resources/pom.xml 2009-04-17 09:23:03 UTC (rev 1083)
@@ -479,7 +479,7 @@
<properties>
<equanda-version>0.9.3</equanda-version>
<staticwiki-version>0.9</staticwiki-version>
- <tapestry-version>5.1.0.0</tapestry-version>
+ <tapestry-version>5.1.0.3</tapestry-version>
<chenillekit-version>1.0.0</chenillekit-version>
</properties>
Modified: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/services/EquandaModule.java 2009-04-17 09:23:03 UTC (rev 1083)
@@ -33,7 +33,6 @@
import org.equanda.tapestry5.bindings.ManifestBindingPrefixFactory;
import org.equanda.tapestry5.translators.BooleanTranslator;
import org.equanda.tapestry5.translators.DoubleTranslator;
-import org.equanda.tapestry5.translators.StringTranslator;
import org.equanda.tapestry5.translators.TimestampTranslator;
import java.io.IOException;
@@ -63,7 +62,6 @@
configuration.add( new DoubleTranslator() );
configuration.add( new TimestampTranslator() );
configuration.add( new BooleanTranslator() );
- configuration.add( new StringTranslator() );
}
public static void contributeFactoryDefaults( MappedConfiguration<String, String> configuration )
Deleted: trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/StringTranslator.java
===================================================================
--- trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/StringTranslator.java 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/equanda-tapestry5/src/main/java/org/equanda/tapestry5/translators/StringTranslator.java 2009-04-17 09:23:03 UTC (rev 1083)
@@ -1,86 +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.tapestry5.translators;
-
-import org.apache.tapestry5.Field;
-import org.apache.tapestry5.FieldTranslator;
-import org.apache.tapestry5.MarkupWriter;
-import org.apache.tapestry5.Translator;
-import org.apache.tapestry5.services.FormSupport;
-
-/**
- * Tapestry translator for string values (doesn't do much)
- *
- * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- */
-public class StringTranslator
- implements Translator<String>, FieldTranslator<String>
-{
- /**
- * Parses the client value to a boolean
- */
- public String parseClient( Field field, String clientValue, String message )
- {
- return clientValue;
- }
-
- /**
- * Converts null to the false, non-null to a string representation.
- */
- public String toClient( String value )
- {
- return value;
- }
-
- public Class<String> getType()
- {
- return String.class;
- }
-
- public String getName()
- {
- return "string";
- }
-
- public String getMessageKey()
- {
- return "string-format-exception";
- }
-
- public void render( Field field, String message, MarkupWriter markupWriter, FormSupport formSupport )
- {
- formSupport.addValidation( field, "string", message, null );
- }
-
- public String parse( String clientValue )
- {
- return clientValue;
- }
-
- public void render( MarkupWriter markupWriter )
- {
- // @todo don't know what to do here
- }
-}
Modified: trunk/equanda-test/pom.xml
===================================================================
--- trunk/equanda-test/pom.xml 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/equanda-test/pom.xml 2009-04-17 09:23:03 UTC (rev 1083)
@@ -146,7 +146,7 @@
</dependencyManagement>
<properties>
- <tapestry-version>5.1.0.0</tapestry-version>
+ <tapestry-version>5.1.0.3</tapestry-version>
</properties>
</project>
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-04-09 13:21:20 UTC (rev 1082)
+++ trunk/pom.xml 2009-04-17 09:23:03 UTC (rev 1083)
@@ -616,7 +616,7 @@
</profiles>
<properties>
- <tapestry-release-version>5.1.0.1</tapestry-release-version>
+ <tapestry-release-version>5.1.0.3</tapestry-release-version>
<chenillekit-version>1.0.0</chenillekit-version>
<staticwiki-release-version>0.9.1-SNAPSHOT</staticwiki-release-version>
</properties>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-04-09 13:21:37
|
Revision: 1082
http://equanda.svn.sourceforge.net/equanda/?rev=1082&view=rev
Author: triathlon98
Date: 2009-04-09 13:21:20 +0000 (Thu, 09 Apr 2009)
Log Message:
-----------
EQ-336 properly set isGuiAccessProhibited in LoginInfo
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm
Modified: trunk/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm 2009-04-09 00:42:52 UTC (rev 1081)
+++ trunk/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm 2009-04-09 13:21:20 UTC (rev 1082)
@@ -95,7 +95,7 @@
roles.add( role.getAppserverRole() );
}
}
- if ( isNotGuiCount == roles.size() && isNotGuiCount != 0 ) isNotGui = true;
+ if ( isNotGuiCount == dmUser.getRoles().size() && isNotGuiCount != 0 ) isNotGui = true;
// fix incomplete configurations
if ( roles.isEmpty() )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-04-09 00:43:02
|
Revision: 1081
http://equanda.svn.sourceforge.net/equanda/?rev=1081&view=rev
Author: triathlon98
Date: 2009-04-09 00:42:52 +0000 (Thu, 09 Apr 2009)
Log Message:
-----------
small improvements
Modified Paths:
--------------
trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Action.java
trunk/equanda-dm/src/main/resources/org/equanda/infrastructure/useradmin/EquandaUser.table
Modified: trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Action.java
===================================================================
--- trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Action.java 2009-04-08 20:31:15 UTC (rev 1080)
+++ trunk/equanda-dm/src/main/java/org/equanda/domain/xml/Action.java 2009-04-09 00:42:52 UTC (rev 1081)
@@ -110,7 +110,7 @@
public String getSecurityRole()
{
- if ( securityRole == null && table != null ) return table.getSecurityRole();
+ if ( securityRole == null && table != null ) securityRole = table.getSecurityRole();
return securityRole;
}
Modified: trunk/equanda-dm/src/main/resources/org/equanda/infrastructure/useradmin/EquandaUser.table
===================================================================
--- trunk/equanda-dm/src/main/resources/org/equanda/infrastructure/useradmin/EquandaUser.table 2009-04-08 20:31:15 UTC (rev 1080)
+++ trunk/equanda-dm/src/main/resources/org/equanda/infrastructure/useradmin/EquandaUser.table 2009-04-09 00:42:52 UTC (rev 1081)
@@ -67,12 +67,14 @@
</select>
<action name="login">
+ <security-role>NONE</security-role>
<description>
Action which should be called automatically when logging in.
</description>
</action>
<action name="logout">
+ <security-role>NONE</security-role>
<description>
Action which should be called automatically when logging out.
It is not guaranteed that this is called, specifically it will not be called when the session times out.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-04-08 20:31:18
|
Revision: 1080
http://equanda.svn.sourceforge.net/equanda/?rev=1080&view=rev
Author: triathlon98
Date: 2009-04-08 20:31:15 +0000 (Wed, 08 Apr 2009)
Log Message:
-----------
fix assert order (tests: 51/2 remaining, 53 to go)
Modified Paths:
--------------
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java 2009-04-08 20:21:00 UTC (rev 1079)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java 2009-04-08 20:31:15 UTC (rev 1080)
@@ -100,9 +100,9 @@
auto = sel.selectId( auto.getId() );
sel.remove();
- assertEquals( auto.getMultipleAuto().size(), 1 );
- assertEquals( auto.getMultipleAuto().iterator().next(), "test" );
- assertEquals( auto.getAutoInt(), 0 );
+ assertEquals( 1, auto.getMultipleAuto().size() );
+ assertEquals( "test", auto.getMultipleAuto().iterator().next() );
+ assertEquals( 0, auto.getAutoInt() );
}
public void testCreateProxy()
@@ -164,9 +164,9 @@
Collection col = sel.selectName( AIRPLANE_NAME );
assertEquals( col.size(), 1 );
Vehicle obj = (Vehicle) col.iterator().next();
- assertEquals( obj.getRadius(), 10 );
- assertEquals( obj.getSpeed(), 300 );
- assertEquals( obj.getSpanWidth(), 15.0 );
+ assertEquals( 10, obj.getRadius() );
+ assertEquals( 300, obj.getSpeed() );
+ assertEquals( 15.0, obj.getSpanWidth() );
sel.selectId( air.getId() ).removeEntityBean();
sel.remove();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-04-08 20:23:18
|
Revision: 1079
http://equanda.svn.sourceforge.net/equanda/?rev=1079&view=rev
Author: triathlon98
Date: 2009-04-08 20:21:00 +0000 (Wed, 08 Apr 2009)
Log Message:
-----------
fix instantiate proxy (tests: 51/2 remaining, 53 to go)
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-04-08 09:15:42 UTC (rev 1078)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-04-08 20:21:00 UTC (rev 1079)
@@ -255,9 +255,14 @@
#end
public static ${table.Name} get( DM${table.Name} entity )
+ throws EquandaException
{
+ String cname = entity.getClass().getName().substring( "${package}.server.pm.DM".length() );
+ log.debug( "HR${table.Name}.get " + cname );
+ int pos = cname.indexOf( "_$$" );
+ if ( pos > 0 ) cname = cname.substring( 0, pos );
#foreach( $type in $table.TablesNotInternal )
- if ( entity instanceof DM${type.Name} )
+ if ( "${type.Name}".equals( cname ) )
{
DM${type.Name} spec = (DM${type.Name})entity;
return new ${table.Name}( spec.getId(), "$type.Type", spec.getEquandaCreationDate(),
@@ -265,6 +270,5 @@
#foreach( $field in $table.FieldsNotLinkAndNotMultiple ) #typefield( $field $type ) #end );
}
#end
- //throw new EquandaException( ECV_INVALID_TABLE_TYPE, type, "table.${table.Name}" ); , entity.get${field.Name}()
- return null;
+ throw new EquandaException( ECV_INVALID_TABLE_TYPE, cname, "table.${table.Name}" );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-04-08 09:15:54
|
Revision: 1078
http://equanda.svn.sourceforge.net/equanda/?rev=1078&view=rev
Author: triathlon98
Date: 2009-04-08 09:15:42 +0000 (Wed, 08 Apr 2009)
Log Message:
-----------
no more multiple inheritance (tests: 51/2 remaining, 53 to go)
Modified Paths:
--------------
branches/EQ-130/equanda-dm/src/main/resources/equanda.dtd
branches/EQ-130/equanda-test/src/main/dm/Airplane.table
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java
branches/EQ-130/src/site/wiki/dm.wiki
Removed Paths:
-------------
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/InheritanceTest.java
Modified: branches/EQ-130/equanda-dm/src/main/resources/equanda.dtd
===================================================================
--- branches/EQ-130/equanda-dm/src/main/resources/equanda.dtd 2009-04-08 08:05:40 UTC (rev 1077)
+++ branches/EQ-130/equanda-dm/src/main/resources/equanda.dtd 2009-04-08 09:15:42 UTC (rev 1078)
@@ -52,11 +52,12 @@
"category" allows combining tables in categories, useful for building a menu structure
The "internal" attribute when set indicates that this table is only provided to be part of the inheritance tree,
but no instances of this type are allowed to exist.
+ since 0.9.4 only one template is allowed
-->
<!ELEMENT table (
(description)?,
(subjectory)?,
- (template)*,
+ (template)?,
(include)*,
(data-filter)*,
(default-instance)?,
Modified: branches/EQ-130/equanda-test/src/main/dm/Airplane.table
===================================================================
--- branches/EQ-130/equanda-test/src/main/dm/Airplane.table 2009-04-08 08:05:40 UTC (rev 1077)
+++ branches/EQ-130/equanda-test/src/main/dm/Airplane.table 2009-04-08 09:15:42 UTC (rev 1078)
@@ -4,7 +4,7 @@
<table name="Airplane" type="AIRP">
<template parent="VehicleWithWings"/>
- <template parent="VehicleWithWheels"/>
+ <!--<template parent="VehicleWithWheels"/> no longer supported-->
<page>
Deleted: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/InheritanceTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/InheritanceTest.java 2009-04-08 08:05:40 UTC (rev 1077)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/InheritanceTest.java 2009-04-08 09:15:42 UTC (rev 1078)
@@ -1,48 +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.test.xejb;
-
-import org.equanda.test.dm.client.*;
-import org.equanda.test.dm.client.constants.*;
-
-/**
- * tests for possible problems in mediators, with simple and multiple inheritance
- *
- * @author NetRom team
- */
-public class InheritanceTest
- extends TestAdapter
-{
- public void testMultipleInheritance()
- throws Exception
- {
- Vehicle proxy = new Vehicle();
- proxy.setWheelCount( 5 ); // field from one parent
- proxy.setRadius( 10 ); // field from other parent
- proxy.setEquandaType( VehicleConstants.TYPE_Airplane );
- proxy.equandaUpdate();
- //no test, the test verifies that no exception is thrown
- }
-}
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java 2009-04-08 08:05:40 UTC (rev 1077)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java 2009-04-08 09:15:42 UTC (rev 1078)
@@ -157,7 +157,6 @@
air.setName( AIRPLANE_NAME );
air.setRadius( 10 );
air.setSpeed( 300 );
- air.setWheelCount( 3 );
air.setSpanWidth( 15 );
air.equandaUpdate();
@@ -167,7 +166,6 @@
Vehicle obj = (Vehicle) col.iterator().next();
assertEquals( obj.getRadius(), 10 );
assertEquals( obj.getSpeed(), 300 );
- assertEquals( obj.getWheelCount(), 3 );
assertEquals( obj.getSpanWidth(), 15.0 );
sel.selectId( air.getId() ).removeEntityBean();
Modified: branches/EQ-130/src/site/wiki/dm.wiki
===================================================================
--- branches/EQ-130/src/site/wiki/dm.wiki 2009-04-08 08:05:40 UTC (rev 1077)
+++ branches/EQ-130/src/site/wiki/dm.wiki 2009-04-08 09:15:42 UTC (rev 1078)
@@ -42,7 +42,7 @@
Each table can be given a _description_ and semantic annotations using _subectory_.
-The inheritance tree is specified using the _template_ tag. Each template specifies a parent table. Note that it is possible to use multiple inheritance (more than one template tag in a table). In that case all fields from all templates will be available, but the prorammatic constraints need to be repeated (only the programmatic constraints from the first template are automatically applied).
+The inheritance tree is specified using the _template_ tag. Each template specifies a parent table.
On the template tag, you can put the following attributes :
- *parent* : the name of the parent table.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-04-08 08:05:59
|
Revision: 1077
http://equanda.svn.sourceforge.net/equanda/?rev=1077&view=rev
Author: triathlon98
Date: 2009-04-08 08:05:40 +0000 (Wed, 08 Apr 2009)
Log Message:
-----------
uniqueness tests fixed (tests: 50/4 remaining, 54 to go)
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm 2009-04-08 07:32:50 UTC (rev 1076)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm 2009-04-08 08:05:40 UTC (rev 1077)
@@ -375,7 +375,7 @@
#if( $field.isUnique() || $field.isUniqueFor() )
#set( $equandaFor = "" )
#if( $field.isUniqueFor() )
-#set( $equandaFor = ", this.get${field.UniqueForField.Name}().getId()" )
+#set( $equandaFor = ", get${field.UniqueForField.Name}() == null ? null : get${field.UniqueForField.Name}().getId()" )
#end
${table.getRoot().Name}SelectorEJB sel = EquandaGlobal.get${table.getRoot().Name}Selector();
long count = sel.equandaCount${field.Name}( $field.VarName $equandaFor );
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2009-04-08 07:32:50 UTC (rev 1076)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2009-04-08 08:05:40 UTC (rev 1077)
@@ -114,7 +114,7 @@
queryStrings.put( "${table.Name}.equanda${field.Name}Unique", "SELECT COUNT(p) FROM DM${table.Name} p WHERE p.${field.VarName} = :${field.VarName}" );
#end
#foreach( $field in $table.UniqueForFields )
- queryStrings.put( "${table.Name}.equanda${field.Name}Unique", "SELECT COUNT(p) FROM DM${table.Name} p WHERE p.${field.VarName} = :${field.VarName} AND p.${field.UniqueForField.VarName} = :equandaFor");
+ queryStrings.put( "${table.Name}.equanda${field.Name}Unique", "SELECT COUNT(p) FROM DM${table.Name} p WHERE p.${field.VarName} = :${field.VarName} AND p.${field.UniqueForField.VarName}.id = :equandaFor");
#if( $field.UniqueForField.isNullable() )
queryStrings.put( "${table.Name}.equanda${field.Name}UniqueNull", "SELECT COUNT(p) FROM DM${table.Name} p WHERE p.${field.VarName} = :${field.VarName} AND p.${field.UniqueForField.VarName} is null");
#end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-04-08 07:33:28
|
Revision: 1076
http://equanda.svn.sourceforge.net/equanda/?rev=1076&view=rev
Author: triathlon98
Date: 2009-04-08 07:32:50 +0000 (Wed, 08 Apr 2009)
Log Message:
-----------
don't change exception, fix testcase (tests: 50/6 remaining, 56 to go)
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-04-08 07:32:50 UTC (rev 1076)
@@ -225,9 +225,9 @@
#end
}
#if( $hasFields )
- catch( EquandaConstraintViolation e )
+ catch( EquandaException ee )
{
- throw new EquandaConstraintViolation( EPE_PERSISTENCE_EXCEPTION, e, errorField + ", " + e.getClass() );
+ throw ee;
}
#end
catch( Exception e )
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java 2009-04-07 20:56:01 UTC (rev 1075)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/UniqueFieldsTest.java 2009-04-08 07:32:50 UTC (rev 1076)
@@ -69,6 +69,7 @@
{
UniqueFields obj1 = UniqueFields.equandaCreate();
obj1.setUniqueImmutableInt( 1 );
+ obj1.equandaUpdate();
try
{
UniqueFields obj2 = UniqueFields.equandaCreate();
@@ -153,10 +154,10 @@
List<UniqueFields> list = UniqueFields.selectEverything();
assertEquals( 1, list.size() ); // assure filter works at all
- UniqueFields uf3 = UniqueFields.equandaCreate();
- uf3.setUniqueImmutableInt( 2 );
try
{
+ UniqueFields uf3 = UniqueFields.equandaCreate();
+ uf3.setUniqueImmutableInt( 2 );
uf3.equandaUpdate();
fail( "uniqueness should not take filter into account" );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-04-07 20:56:23
|
Revision: 1075
http://equanda.svn.sourceforge.net/equanda/?rev=1075&view=rev
Author: triathlon98
Date: 2009-04-07 20:56:01 +0000 (Tue, 07 Apr 2009)
Log Message:
-----------
uniqueness test improvements (tests: 52/6 remaining, 58 to go)
Modified Paths:
--------------
branches/EQ-130/equanda-client/src/main/java/org/equanda/persistence/EquandaEntity.java
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/LazyProxyList.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectConstants.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorHelper.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorHelperBase.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectType.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectTypeChoice.java.vm
branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/BuilderSetSelectorHelper.java
branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/SecurSelectorHelper.java
branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/VeryDocumentedSelectorHelper.java
Modified: branches/EQ-130/equanda-client/src/main/java/org/equanda/persistence/EquandaEntity.java
===================================================================
--- branches/EQ-130/equanda-client/src/main/java/org/equanda/persistence/EquandaEntity.java 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-client/src/main/java/org/equanda/persistence/EquandaEntity.java 2009-04-07 20:56:01 UTC (rev 1075)
@@ -42,6 +42,8 @@
transient protected boolean equandaStatusModified;
protected Timestamp equandaCreation, equandaModified;
protected long equandaVersion;
+ @Transient
+ protected boolean equandaLoaded;
@EmbeddedId
public Uoid getId()
@@ -75,6 +77,7 @@
protected void equandaPostLoad()
{
equandaStatusModified = false;
+ equandaLoaded = true;
}
@PreUpdate
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -37,6 +37,8 @@
package ${package}.server.pm;
+import ${package}.client.EquandaGlobal;
+import ${package}.client.${table.getRoot().Name}SelectorEJB;
import org.equanda.client.EquandaException;
import org.equanda.client.ExceptionCodes;
import org.equanda.persistence.Uoid;
@@ -117,17 +119,16 @@
private Collection<DM${ck.TableName}> equanda${ck.TableName}${ck.FieldName} = new java.util.ArrayList<DM${ck.TableName}>();
#end
- public DM${table.Name}()
- throws EquandaException
- {
- this( " " );
- }
+ protected DM${table.Name}() throws EquandaException {}
- public DM${table.Name}(String type #foreach( $field in $table.ImmutableFields ), $field.JavaFieldType ${field.VarName}#end )
+ public DM${table.Name}( String modifiedStatus )
throws EquandaException
{
+#if( $table.isInherited() )
+ super( modifiedStatus );
+#end
// initialise all CMP fields
- #foreach( $field in $table.FieldsNotImmutableAndNotCalculated )
+ #foreach( $field in $table.FieldsNotCalculated )
#if( $field.isMultiple() )
#set( $fieldtype=$field.JavaEntityType )
#if( !$field.isLink() && $field.isMultiple() ) #set( $fieldtype="${package}.server.pm.DM${table.Name}_${field.Name}" )#end
@@ -162,16 +163,14 @@
#end ## if multiple else if link else
#end##foreach
-#foreach( $field in $table.ImmutableFields )
- set${field.Name}( $field.VarName );
-#end
// need Uoid, creationdate and base modificationdate
Uoid uoid = UoidGenerator.get();
setId( uoid );
Timestamp ts = new java.sql.Timestamp( System.currentTimeMillis() );
setEquandaCreationDate( ts );
setEquandaModificationDate( ts );
- setEquandaStatus( "M" );
+ setEquandaStatus( modifiedStatus );
+ equandaPostLoad();
}
#if( !$table.isInherited() )
@@ -359,6 +358,7 @@
## only do something if the new value is different from the old
if ( !StringUtil.objectEquals( this.${field.VarName}, $field.VarName ) )
{
+ if ( equandaLoaded ) {
#* check constraints *#
#parse("DMObject-mutable.java.vm")
#if ( ( $field.isString() || $field.isDate() || $field.isTimestamp() ) && $field.isRequired() )
@@ -375,15 +375,17 @@
#if( $field.isUnique() || $field.isUniqueFor() )
#set( $equandaFor = "" )
#if( $field.isUniqueFor() )
-#set( $equandaFor = ", this.${field.UniqueForField.Name}" )
+#set( $equandaFor = ", this.get${field.UniqueForField.Name}().getId()" )
#end
-/* @todo should use DMObjectSelector and injected entitymanager for test
- if ( object.count${field.Name}( $field.VarName $equandaFor) > 0 )
+ ${table.getRoot().Name}SelectorEJB sel = EquandaGlobal.get${table.getRoot().Name}Selector();
+ long count = sel.equandaCount${field.Name}( $field.VarName $equandaFor );
+ sel.remove();
+ if ( count > 0 )
{
throw new EquandaConstraintViolation( ExceptionCodes.ECV_FIELD_IS_UNIQUE, "field.${table.Name}.${field.Name}" );
}
-*/
#end
+ }
this.${field.VarName} = ${field.VarName};
}
#else## field.isLink()
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -231,7 +231,7 @@
#end
#foreach( $field in $table.UniqueForFields )
public static long count${field.Name}( EntityManager em, ${field.JavaFieldType} ${field.VarName},
- ${field.UniqueForField.JavaEntityType} equandaFor )
+ Uoid equandaFor )
{
EquandaQuery query;
if ( null != equandaFor )
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -25,8 +25,7 @@
*
* Contributor(s):
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- *#
-/**
+ *#/**
* This file is generated by equanda on $generationdate, do not modify
*/
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/LazyProxyList.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/LazyProxyList.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/LazyProxyList.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -25,8 +25,7 @@
*
* Contributor(s):
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- *#
-/**
+ *#/**
* This file is generated by equanda on $generationdate, do not modify
*/
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectConstants.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectConstants.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectConstants.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -25,8 +25,7 @@
*
* Contributor(s):
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- *#
-/**
+ *#/**
* This file is generated by equanda on $generationdate, do not modify
*
* ${table.Name}Constants defines all the contants for the table
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -315,7 +315,7 @@
}
#if( $field.isLink() || $field.isMultiple() )
- /** this method is called on first use of the link|multiple field. */
+ /** this method is called on first use of the link/multiple field. */
private void initField${field.Name}()
throws EquandaException
{
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxyState.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -25,8 +25,7 @@
*
* Contributor(s):
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- *#
-/**
+ *#/**
* This file is generated by equanda on $generationdate, do not modify
*/
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -163,11 +163,7 @@
return get( entity );
}
- /*
- * @ejb.interface-method
- * @ejb.permission
- * unchecked="true"
- */
+ @PermitAll
public ${package}.client.${table.Name}[] selectMultipleId(Uoid[] arr) throws EquandaException {
if ( arr == null ) return null;
${package}.client.${table.Name}[] proxies = new ${package}.client.${table.Name}[ arr.length ];
@@ -377,7 +373,7 @@
{
DM${table.Name} entity = null;
#foreach( $type in $table.TablesNotInternal )
- if ( "${type.Type}".equals( type ) ) entity = new DM${type.Name}();
+ if ( "${type.Type}".equals( type ) ) entity = new DM${type.Name}( "M" );
#end
return entity;
}
@@ -422,8 +418,8 @@
}
/*
- * Return a refreshed proxy if it has changed.
- */
+ * Return a refreshed proxy if it has changed.
+ */
@RolesAllowed({ "LocalUser" ,"LocalAdmin" })
public ${package}.client.${table.Name} equandaRefresh( Uoid id, long version ) throws EquandaException {
if ( id == null ) return null;
@@ -629,7 +625,33 @@
public void remove()
{}
+ // ---------- special accessors for unique fields
+#foreach( $field in $table.UniqueFields )
+ public long equandaCount${field.Name}( ${field.JavaFieldType} ${field.VarName} )
+ {
+#if( $field.isString() || $field.isDate() || $field.isTimestamp() )
+ if ( $field.VarName == null ) return 0;
+#end
+ long count = HR${table.Name}.count${field.Name}( entityManager, ${field.VarName} );
+ if ( log.isDebugEnabled() ) log.debug( "uniqueness test count$field.Name " + ${field.VarName} + " " + count );
+ return count;
+ }
+#end
+
+
+#foreach( $field in $table.UniqueForFields )
+ public long equandaCount${field.Name}( ${field.JavaFieldType} ${field.VarName}, Uoid equandaFor )
+ {
+#if( $field.isString() || $field.isDate() || $field.isTimestamp() )
+ if ( $field.VarName == null ) return 0;
+#end
+ long count = HR${table.Name}.count${field.Name}( entityManager, ${field.VarName}, equandaFor );
+ if ( log.isDebugEnabled() ) log.debug( "uniqueness test count$field.Name " + ${field.VarName} + " " + count + " for " + equandaFor );
+ return count;
+ }
+#end
+
// ---------- special accessors for linked fields from proxies
#foreach( $field in $table.MultipleOrLinkFieldsNotInternal )
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -114,6 +114,16 @@
void remove();
+ // ---------- special accessors for unique fields
+
+#foreach( $field in $table.UniqueFields )
+ long equandaCount${field.Name}( ${field.JavaFieldType} ${field.VarName} );
+#end
+
+#foreach( $field in $table.UniqueForFields )
+ long equandaCount${field.Name}( ${field.JavaFieldType} ${field.VarName}, Uoid equandaFor );
+#end
+
// ---------- special accessors for linked fields from proxies
#foreach( $field in $table.MultipleOrLinkFieldsNotInternal )
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorHelper.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorHelper.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorHelper.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -25,8 +25,7 @@
*
* Contributor(s):
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- *#
-/**
+ *#/**
* This file is generated by equanda
* on $generationdate
* helper class for selector, implementation
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorHelperBase.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorHelperBase.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorHelperBase.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -29,8 +29,7 @@
*
* Contributor(s):
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- *#
-/**
+ *#/**
* This file is generated by equanda
* on $generationdate
* helper class for selector, base interface
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectType.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectType.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectType.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -25,8 +25,7 @@
*
* Contributor(s):
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- *#
-/**
+ *#/**
* This file is generated by equanda on $generationdate, do not modify
*
* Special utility class to determine whether this object is of a certain type
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectTypeChoice.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectTypeChoice.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectTypeChoice.java.vm 2009-04-07 20:56:01 UTC (rev 1075)
@@ -25,8 +25,7 @@
*
* Contributor(s):
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- *#
-/**
+ *#/**
* This file is generated by equanda on $generationdate, do not modify
*
* Special utility class to determine whether this object is of a certain type
Modified: branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/BuilderSetSelectorHelper.java
===================================================================
--- branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/BuilderSetSelectorHelper.java 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/BuilderSetSelectorHelper.java 2009-04-07 20:56:01 UTC (rev 1075)
@@ -49,6 +49,6 @@
public DMBuilderSet buildTestBuild()
throws EquandaException
{
- return new DMBuilderSet();
+ return new DMBuilderSet( "M" );
}
}
Modified: branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/SecurSelectorHelper.java
===================================================================
--- branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/SecurSelectorHelper.java 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/SecurSelectorHelper.java 2009-04-07 20:56:01 UTC (rev 1075)
@@ -47,7 +47,7 @@
public DMSecur buildTestBuildAdmin()
throws EquandaException
{
- DMSecur bs = new DMSecur();
+ DMSecur bs = new DMSecur( "M" );
//bs.init( 0 );
return bs;
}
@@ -55,7 +55,7 @@
public DMSecur buildTestBuildLocalUser()
throws EquandaException
{
- DMSecur bs = new DMSecur();
+ DMSecur bs = new DMSecur( "M" );
//bs.init( 0 );
return bs;
}
Modified: branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/VeryDocumentedSelectorHelper.java
===================================================================
--- branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/VeryDocumentedSelectorHelper.java 2009-04-07 15:46:09 UTC (rev 1074)
+++ branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/VeryDocumentedSelectorHelper.java 2009-04-07 20:56:01 UTC (rev 1075)
@@ -47,14 +47,14 @@
public DMVeryDocumented buildBuild1()
throws EquandaException
{
- DMVeryDocumented bs = new DMVeryDocumented();
+ DMVeryDocumented bs = new DMVeryDocumented( "M" );
return bs;
}
public DMVeryDocumented buildBuild2()
throws EquandaException
{
- DMVeryDocumented bs = new DMVeryDocumented();
+ DMVeryDocumented bs = new DMVeryDocumented( "M" );
return bs;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-04-07 15:47:00
|
Revision: 1074
http://equanda.svn.sourceforge.net/equanda/?rev=1074&view=rev
Author: triathlon98
Date: 2009-04-07 15:46:09 +0000 (Tue, 07 Apr 2009)
Log Message:
-----------
ifixes in delegation of value (tests: 57/4 remaining, 61 to go)
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm 2009-03-31 16:52:21 UTC (rev 1073)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm 2009-04-07 15:46:09 UTC (rev 1074)
@@ -286,8 +286,40 @@
#if( $field.isMultiple() )
if ( null == ${field.VarName} ) ${field.VarName} = new ArrayList<$fieldtype2>();
#end
+#if( $field.hasValueWhenNull() )
+ if ( null == ${field.VarName} ) {
+ #if( !$field.hasDelegatePath() )
+ return get${field.ValueWhenDelegateField}();
+ #else
+ DM${field.ValueWhenDelegatePath.LinkTable.Name} tmpLink = get${field.ValueWhenDelegatePath.Name}();
+ if ( tmpLink == null ) return null;
+ return tmpLink.get${field.ValueWhenDelegateField}();
+ #end
+ }
+#elseif( $field.hasValueWhenZero() )
+ $fieldtype tmp = entity.get${field.Name}();
+ #if( $field.isBoolean() )
+ if ( ${field.VarName} == false ) {
+ #else
+ if ( ${field.VarName} == 0 ) {
+ #end
+ #if( !$field.hasDelegatePath() )
+ return get${field.ValueWhenDelegateField}();
+ #else
+ DM${field.ValueWhenDelegatePath.LinkTable.Name} tmpLink = get${field.ValueWhenDelegatePath.Name}();
+ if ( tmpLink == null )
+ #if( $field.isBoolean() )
+ return false;
+ #else
+ return 0;
+ #end
+ return tmpLink.get${field.ValueWhenDelegateField}();
+ #end
+ }
+#end
return ${field.VarName};
}
+
public void set${field.Name}($fieldtype $field.VarName)
throws EquandaException
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-31 16:52:44
|
Revision: 1073
http://equanda.svn.sourceforge.net/equanda/?rev=1073&view=rev
Author: triathlon98
Date: 2009-03-31 16:52:21 +0000 (Tue, 31 Mar 2009)
Log Message:
-----------
fix CCE
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HRObject.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HRObject.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HRObject.java.vm 2009-03-31 14:08:13 UTC (rev 1072)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HRObject.java.vm 2009-03-31 16:52:21 UTC (rev 1073)
@@ -42,6 +42,7 @@
import org.equanda.persistence.Uoid;
import org.equanda.client.ExceptionCodes;
import org.equanda.persistence.ConcurrentModificationException;
+import org.equanda.persistence.EquandaOperationNotAllowed;
import org.equanda.persistence.EquandaList;
import org.equanda.persistence.EquandaConstraintViolation;
import org.equanda.persistence.EquandaPersistenceException;
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-03-31 14:08:13 UTC (rev 1072)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-03-31 16:52:21 UTC (rev 1073)
@@ -35,7 +35,12 @@
#if( $field.isImmutable() )
if ( null != obj.getId() ) throw new EquandaConstraintViolation(ECV_IMMUTABLE_FIELD_CANNOT_CHANGE_AFTER_CREATE );
#end
+#if( $field.DmTable.isInherited() )
+ if ( !( entity instanceof DM${field.DmTable.Name} ) ) throw new EquandaOperationNotAllowed( UONA_OPERATION_NOT_ALLOWED, "$table.Name, set$field.Name on "+entity.getClass().getName());
DM${field.DmTable.Name} spec = (DM${field.DmTable.Name})entity;
+#else
+ DM${field.DmTable.Name} spec = entity;
+#end
#set( $fieldtype = $field.JavaFieldType )
#set( $hasFields = true )
#if( $field.isLink() )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-31 14:08:46
|
Revision: 1072
http://equanda.svn.sourceforge.net/equanda/?rev=1072&view=rev
Author: triathlon98
Date: 2009-03-31 14:08:13 +0000 (Tue, 31 Mar 2009)
Log Message:
-----------
improvements in multiple field handling, (tests: 63/4 remaining, 67 to go)
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm 2009-03-31 07:30:15 UTC (rev 1071)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm 2009-03-31 14:08:13 UTC (rev 1072)
@@ -107,13 +107,13 @@
#elseif ( $field.isMultiple() ) #set( $fieldtype="${package}.server.pm.DM${table.Name}_${field.Name}" )
#end
#if( $field.isMultiple() )
- private Collection<$fieldtype> $field.VarName = new ArrayList<$fieldtype>();
+ private Collection<$fieldtype> $field.VarName;
#set( $fieldtype="Collection<$fieldtype>" )
#else
private $fieldtype $field.VarName;
#end
#end##foreach field
-#foreach( $ck in $table.CascadeKeepNotBidirectional )
+#foreach( $ck in $table.Root.CascadeKeepNotBidirectional )
private Collection<DM${ck.TableName}> equanda${ck.TableName}${ck.FieldName} = new java.util.ArrayList<DM${ck.TableName}>();
#end
@@ -174,13 +174,15 @@
setEquandaStatus( "M" );
}
- #foreach( $ck in $table.CascadeKeepNotBidirectional )
+#if( !$table.isInherited() )
+ #foreach( $ck in $table.Root.CascadeKeepNotBidirectional )
// CascadeKeep bidi $ck.isBidirectional() $ck.Name $ck.FieldName $ck.LinkedTableName
@BatchSize( size=$linkBatch )
#if( $ck.isFieldMultiple() ) @ManyToMany #else @OneToMany #end
( /*cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH },*/ mappedBy = "${ck.VarName}", fetch = FetchType.LAZY )
public Collection<DM${ck.TableName}> getEquanda${ck.TableName}${ck.FieldName}()
{
+ if ( null == equanda${ck.TableName}${ck.FieldName} ) equanda${ck.TableName}${ck.FieldName} = new java.util.ArrayList<DM${ck.TableName}>();
return equanda${ck.TableName}${ck.FieldName};
}
public void setEquanda${ck.TableName}${ck.FieldName}(Collection<DM${ck.TableName}> set)
@@ -188,6 +190,7 @@
equanda${ck.TableName}${ck.FieldName} = set;
}
#end
+#end
#macro ( cacheTypeMacro $param )
#if( !$param.isLink() || !${param.isBidirectional()} || $param.isOwner() )
@@ -236,7 +239,10 @@
#if( $field.isLink() ) #set( $fieldtype="${field.JavaEntityType}" )
#elseif ( $field.isMultiple() ) #set( $fieldtype="${package}.server.pm.DM${table.Name}_${field.Name}" )
#end
-#if( $field.isMultiple() )#set( $fieldtype="Collection<$fieldtype>" )#end
+#if( $field.isMultiple() )
+ #set( $fieldtype2 = $fieldtype )
+ #set( $fieldtype="Collection<$fieldtype>" )
+#end
## set O/R and cascade type
#if( $field.isMultiple() )
@@ -275,7 +281,13 @@
#end##isLink
#end##isMultiple
#cacheTypeMacro( $field )
- public $fieldtype get${field.Name}() { return ${field.VarName}; }
+ public $fieldtype get${field.Name}()
+ {
+#if( $field.isMultiple() )
+ if ( null == ${field.VarName} ) ${field.VarName} = new ArrayList<$fieldtype2>();
+#end
+ return ${field.VarName};
+ }
public void set${field.Name}($fieldtype $field.VarName)
throws EquandaException
{
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-31 07:30:15 UTC (rev 1071)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-31 14:08:13 UTC (rev 1072)
@@ -506,7 +506,7 @@
if ( null != entity )
{
#foreach( $ck in $table.CascadeKeep )
-// CascadeKeep bidi $ck.isBidirectional() fieldname $ck.FieldName linkedfieldname $ck.LinkedFieldName table $ck.LinkedTableName varname $ck.VarName owner $ck.isOwner
+// CascadeKeep bidi $ck.isBidirectional() fieldname $ck.FieldName linkedfieldname $ck.LinkedFieldName table $ck.TableName varname $ck.VarName owner $ck.isOwner
#if ( $ck.isBidirectional() )
#if( $ck.isMultiple() )
if ( !entity.get${ck.linkedFieldName}().isEmpty() )
@@ -514,8 +514,7 @@
if ( null != entity.get${ck.linkedFieldName}() )
#end
#else
- //if ( !entity.getEquanda${ck.TableName}${ck.FieldName}().isEmpty() )
- if ( false )
+ if ( !entity.getEquanda${ck.TableName}${ck.FieldName}().isEmpty() )
#end
{
#if( $ck.isBidirectional() )
@@ -559,10 +558,9 @@
#if( $ck.isCascade() )
throw new EquandaConstraintViolation(ECV_CASCADE_KEEP, "${ck.TableName}.${ck.FieldName}");
#else
- /*
#if( $ck.isOwner() )
#if( !$ck.isMultiple() )
- entity.setEquanda${ck.TableName}${ck.FieldName}(null);
+ entity.setEquanda${ck.TableName}${ck.FieldName}( null );
#else
entity.setEquanda${ck.TableName}${ck.FieldName}.clear();
#end
@@ -586,13 +584,13 @@
#end
}
#end
- */
#end ## is Cascade
#end
}
#end
-#foreach( $field in $table.EmbeddedLinkFields )
+#foreach( $field in $table.LinkFields )
+#if( $field.isEmbedded() )
#if( !$field.isMultiple() )
if ( entity.get${field.Name}() != null )
{
@@ -615,6 +613,7 @@
}
#end
#end
+#end
entityManager.remove( entity );
}
}
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-03-31 07:30:15 UTC (rev 1071)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-03-31 14:08:13 UTC (rev 1072)
@@ -49,7 +49,9 @@
if ( al == null || al.isEmpty() )
{
Collection<$fieldtype2> fvl = spec.get${field.Name}();
+#if( $field.isEmbedded() || !$field.isLink())
for ( $fieldtype2 rem : fvl ) em.remove( rem );
+#end
fvl.clear();
}
else
@@ -86,7 +88,10 @@
boolean contains = false;
for ( $fieldtype2 test : last )
{
- contains |= ito.getId().equals( test.getId() );
+ if ( ito.getId().equals( test.getId() ) ) {
+ contains = true;
+ break;
+ }
}
if ( !contains )
{
@@ -99,22 +104,34 @@
Collection<$fieldtype2> fvl = spec.get${field.Name}();
if ( !( al instanceof EquandaList ) )
{
- if ( al.size() != fvl.size() ) {
+ while ( al.size() != fvl.size() ) // while to prevent ConcurrentModificationException
+ {
for ( $fieldtype2 inst : fvl )
{
#if( $field.isLink() )
boolean found = false;
for ( $fieldtype uv : al )
{
- if ( inst.equals( uv.getId() ) )
+ if ( inst.getId().equals( uv.getId() ) )
{
found = true;
break;
}
}
- if ( !found ) em.remove( inst );
+ if ( !found ) {
+ fvl.remove( inst );
+#if( $field.isEmbedded() )
+ em.remove( inst );
+#end
+ break; // prevent ConcurrentModificationException
+ }
#else
- if ( !al.contains( inst ) ) em.remove( inst );
+ if ( !al.contains( inst.get${field.Name}() ) )
+ {
+ fvl.remove( inst );
+ em.remove( inst );
+ break; // prevent ConcurrentModificationException
+ }
#end
}
}
@@ -130,7 +147,11 @@
#if( $field.isLink() )
if ( ro != null && ro.getId() != null )
{
- em.remove( em.find( DM${field.LinkTableName}.class, ro.getId() ) );
+ DM${field.LinkTableName} item = em.find( DM${field.LinkTableName}.class, ro.getId() );
+ spec.get${field.Name}().remove( item );
+#if( $field.isEmbedded() )
+ em.remove( item );
+#end
}
#else
for ( $fieldtype2 test : spec.get${field.Name}() )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-31 07:31:34
|
Revision: 1071
http://equanda.svn.sourceforge.net/equanda/?rev=1071&view=rev
Author: triathlon98
Date: 2009-03-31 07:30:15 +0000 (Tue, 31 Mar 2009)
Log Message:
-----------
fixes for inheritance (down to 62/11, 73 to go)
Modified Paths:
--------------
branches/EQ-130/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java
branches/EQ-130/equanda-dm/src/main/java/org/equanda/domain/xml/Compare.java
branches/EQ-130/equanda-dm/src/main/java/org/equanda/domain/xml/Constraints.java
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CompareTest.java
Modified: branches/EQ-130/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java
===================================================================
--- branches/EQ-130/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java 2009-03-28 14:15:28 UTC (rev 1070)
+++ branches/EQ-130/equanda-client/src/main/java/org/equanda/persistence/ObjectSelector.java 2009-03-31 07:30:15 UTC (rev 1071)
@@ -30,7 +30,6 @@
import javax.persistence.EntityManager;
import javax.persistence.Query;
-import java.util.Collection;
import java.util.Map;
/**
@@ -56,7 +55,7 @@
}
public static Query getEquandaQuery( EntityManager em, EquandaQuery equandaQuery, String queryString,
- boolean setLimits )
+ boolean setLimits )
{
if ( queryString == null ) queryString = equandaQuery.getQueryString();
queryString = addTypeFilter( queryString, equandaQuery.getTypeFilter() );
@@ -123,65 +122,72 @@
if ( wherePart != null && wherePart.length() > 0 )
{
-
- int orderPos = query.indexOf( " ORDER " );
- if ( orderPos == -1 )
+ if ( wherePart.startsWith( "@FROM " ) )
{
- if ( query.indexOf( " WHERE " ) == -1 )
+ query = new StringBuffer( addTypeFilter( query.toString(), wherePart.substring( 6 ) ) );
+ int pos = query.indexOf( "FROM" );
+ if ( pos > 0 )
{
- query.append( " WHERE " );
- query.append( wherePart );
+ int end = query.indexOf( " o", pos + 6 );
+ query.replace( pos + 5, end, wherePart.substring( 6 ) );
}
- else
- {
- query.append( " AND " );
- query.append( wherePart );
- }
}
else
{
- String order = query.substring( orderPos );
- query.setLength( orderPos );
- if ( query.indexOf( " WHERE " ) == -1 )
+ int orderPos = query.indexOf( " ORDER " );
+ if ( orderPos == -1 )
{
- query.append( " WHERE " );
- query.append( wherePart );
+ if ( query.indexOf( " WHERE " ) == -1 )
+ {
+ query.append( " WHERE " );
+ query.append( wherePart );
+ }
+ else
+ {
+ query.append( " AND " );
+ query.append( wherePart );
+ }
}
else
{
- query.append( " AND " );
- query.append( wherePart );
+ String order = query.substring( orderPos );
+ query.setLength( orderPos );
+ if ( query.indexOf( " WHERE " ) == -1 )
+ {
+ query.append( " WHERE " );
+ query.append( wherePart );
+ }
+ else
+ {
+ query.append( " AND " );
+ query.append( wherePart );
+ }
+ query.append( order );
}
- query.append( order );
}
}
return query.toString();
}
- public static String addTypeFilter( String query, ObjectType type )
+ public static String addTypeFilter( String orgQuery, String tableName )
{
- if ( type == null ) return query;
- StringBuffer filter = new StringBuffer();
- Collection<String> types = type.getAllowedStringValues();
-
- // get selected object from query string
- String obj = getQueryObject( query );
-
- String sep = "";
- filter.append( obj );
- filter.append( ".equandaType in (" );
- for ( String t : types )
+ if ( null == tableName ) return orgQuery;
+ StringBuffer query = new StringBuffer( orgQuery );
+ int pos = query.indexOf( "FROM" );
+ if ( pos > 0 )
{
- filter.append( sep );
- filter.append( '\'' );
- filter.append( t );
- filter.append( '\'' );
- sep = ",";
+ int end = query.indexOf( " o", pos + 6 );
+ query.replace( pos + 5, end, tableName );
}
- filter.append( ')' );
- return addFilter( query, "", filter.toString() );
+ return query.toString();
}
+ public static String addTypeFilter( String query, ObjectType type )
+ {
+ if ( null == type ) return query;
+ return addTypeFilter( query, "DM" + type.getName() );
+ }
+
/**
* Get query string for the count query
*
@@ -278,7 +284,7 @@
* @return the new calculated query
*/
public static String setFilter( EquandaQuery equandaQuery, String queryStr, String name, String fromPart,
- String wherePart )
+ String wherePart )
{
String value = SelectorsState.getFilter( name );
if ( null != value )
Modified: branches/EQ-130/equanda-dm/src/main/java/org/equanda/domain/xml/Compare.java
===================================================================
--- branches/EQ-130/equanda-dm/src/main/java/org/equanda/domain/xml/Compare.java 2009-03-28 14:15:28 UTC (rev 1070)
+++ branches/EQ-130/equanda-dm/src/main/java/org/equanda/domain/xml/Compare.java 2009-03-31 07:30:15 UTC (rev 1071)
@@ -51,6 +51,8 @@
private boolean tableLevel;
@XStreamOmitField
private String typeValue;
+ @XStreamOmitField
+ private String typeName;
public String getTest()
{
@@ -106,4 +108,14 @@
{
this.typeValue = typeValue;
}
+
+ public String getTypeName()
+ {
+ return typeName;
+ }
+
+ public void setTypeName( String typeName )
+ {
+ this.typeName = typeName;
+ }
}
Modified: branches/EQ-130/equanda-dm/src/main/java/org/equanda/domain/xml/Constraints.java
===================================================================
--- branches/EQ-130/equanda-dm/src/main/java/org/equanda/domain/xml/Constraints.java 2009-03-28 14:15:28 UTC (rev 1070)
+++ branches/EQ-130/equanda-dm/src/main/java/org/equanda/domain/xml/Constraints.java 2009-03-31 07:30:15 UTC (rev 1071)
@@ -294,6 +294,7 @@
if ( option.getName().equals( value ) )
{
valueValid = true;
+ compare.setTypeName( option.getName() );
compare.setTypeValue( option.getType() );
}
}
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2009-03-28 14:15:28 UTC (rev 1070)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2009-03-31 07:30:15 UTC (rev 1071)
@@ -123,14 +123,13 @@
#foreach( $field in $table.LinkFields )
#if( $field.hasCompare() )
-#* @todo need to fix
#set( $sep = "" )
#set( $test = "" )
#foreach( $ii in $field.Compares )
-#set( $test = "$sep o.equandaType = '${ii.TypeValue}'" )
+##set( $test = "$test$sep o.equandaType = '${ii.TypeValue}'" )
+#set( $test = "@FROM ${ii.TypeName} $test" )
#set( $sep = "" )
#end
-*#
queryStrings.put( "${table.Name}.equandaCompareType${field.Name}", "$test" );
#end
#end
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-28 14:15:28 UTC (rev 1070)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-31 07:30:15 UTC (rev 1071)
@@ -372,6 +372,16 @@
}
#end ## foreach builder
+ public DM${table.Name} getNewEntity( String type )
+ throws EquandaException
+ {
+ DM${table.Name} entity = null;
+#foreach( $type in $table.TablesNotInternal )
+ if ( "${type.Type}".equals( type ) ) entity = new DM${type.Name}();
+#end
+ return entity;
+ }
+
#if( $table.isCloneable() )
/*
* $build.Description
@@ -379,7 +389,7 @@
#buildSecurityRole( $build )
public ${package}.client.${table.Name} equandaClone( String type, Uoid base ) throws EquandaException {
//DM${table.Name} base = HR${table.Name}.selectId( entityManager, base );
- DM${table.Name} entity = new DM${table.Name}();
+ DM${table.Name} entity = getNewEntity( type );
//setAutoFields(entity);
//mediator.equandaClone( other );
#parse("ObjectSelector-build.java.vm")
@@ -397,7 +407,7 @@
DM${table.Name} entity;
Uoid id = proxy.getId();
if ( null == id )
- entity = new DM${table.Name}();
+ entity = getNewEntity( proxy.getEquandaType() );
//obj.init( proxy.getEquandaType() #foreach( $field in $table.ImmutableFields ), proxy.get${field.Name}() #set( $sep="," )#end );
else
entity = HR${table.Name}.selectId( entityManager, id );
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CompareTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CompareTest.java 2009-03-28 14:15:28 UTC (rev 1070)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CompareTest.java 2009-03-31 07:30:15 UTC (rev 1071)
@@ -395,13 +395,12 @@
try
{
obj.equandaUpdate();
+ fail( "type compare constraint not adhered for single linked fields" );
}
catch ( EquandaException epe )
{
assertEquals( ExceptionCodes.ECV_COMPARE_TYPE_CONSTRAINT_NOT_SATISFIED, epe.getExceptionCode() );
- return;
}
- fail( "type compare constraint not adhered for single linked fields" );
}
public void testCompareLinkTypeMultipleAllowed()
@@ -440,12 +439,11 @@
try
{
obj.equandaUpdate();
+ fail( "type compare constraint not adhered for multiple linked fields" );
}
catch ( EquandaException epe )
{
assertEquals( ExceptionCodes.ECV_COMPARE_TYPE_CONSTRAINT_NOT_SATISFIED, epe.getExceptionCode() );
- return;
}
- fail( "type compare constraint not adhered for multiple linked fields" );
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-28 14:15:39
|
Revision: 1070
http://equanda.svn.sourceforge.net/equanda/?rev=1070&view=rev
Author: triathlon98
Date: 2009-03-28 14:15:28 +0000 (Sat, 28 Mar 2009)
Log Message:
-----------
prefered -> preferred and fix some tests (to 56/21)
Modified Paths:
--------------
branches/EQ-130/equanda-test/src/main/dm/Owner.table
branches/EQ-130/equanda-test/test-core/src/main/resources/translations.txt
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/RemoveLinksTest.java
Modified: branches/EQ-130/equanda-test/src/main/dm/Owner.table
===================================================================
--- branches/EQ-130/equanda-test/src/main/dm/Owner.table 2009-03-27 20:28:17 UTC (rev 1069)
+++ branches/EQ-130/equanda-test/src/main/dm/Owner.table 2009-03-28 14:15:28 UTC (rev 1070)
@@ -18,7 +18,7 @@
<multiple/>
</field>
- <field name="PreferedCar" type="Car">
+ <field name="PreferredCar" type="Car">
<link-name>FanCar</link-name>
</field>
@@ -70,12 +70,12 @@
<select name="Name" type="single">
<selection field="Name"/>
</select>
- <select name="SinglePreferedCar" type="single">
- <selection table="Car" field="Brand" path="preferedCar"/>
+ <select name="SinglePreferredCar" type="single">
+ <selection table="Car" field="Brand" path="preferredCar"/>
</select>
- <select name="MorePreferedCar">
- <selection table="Car" field="Brand" path="preferedCar"/>
+ <select name="MorePreferredCar">
+ <selection table="Car" field="Brand" path="preferredCar"/>
<selection field="Name"/>
</select>
</table>
Modified: branches/EQ-130/equanda-test/test-core/src/main/resources/translations.txt
===================================================================
--- branches/EQ-130/equanda-test/test-core/src/main/resources/translations.txt 2009-03-27 20:28:17 UTC (rev 1069)
+++ branches/EQ-130/equanda-test/test-core/src/main/resources/translations.txt 2009-03-28 14:15:28 UTC (rev 1070)
@@ -433,8 +433,8 @@
.label.en Name
.key field.Owner.Passport/equanda-table
.label.en Passport
-.key field.Owner.PreferedCar/equanda-table
-.label.en PreferedCar
+.key field.Owner.PreferredCar/equanda-table
+.label.en PreferredCar
.key field.Passport.Identifier/equanda-table
.label.en Identifier
.key field.Passport.Owner/equanda-table
@@ -945,13 +945,13 @@
.label.en Name
.key parameter.Linkable.EquandaNameStart.Name/equanda-table
.label.en Name
-.key parameter.Owner.MorePreferedCar.Brand/equanda-table
+.key parameter.Owner.MorePreferredCar.Brand/equanda-table
.label.en Brand
-.key parameter.Owner.MorePreferedCar.Name/equanda-table
+.key parameter.Owner.MorePreferredCar.Name/equanda-table
.label.en Name
.key parameter.Owner.Name.Name/equanda-table
.label.en Name
-.key parameter.Owner.SinglePreferedCar.Brand/equanda-table
+.key parameter.Owner.SinglePreferredCar.Brand/equanda-table
.label.en Brand
.key parameter.Owner.EquandaNamePart.Name/equanda-table
.label.en Name
@@ -1209,12 +1209,12 @@
.label.en equandaNamePart
.key select.Linkable.EquandaNameStart/equanda-table
.label.en equandaNameStart
-.key select.Owner.MorePreferedCar/equanda-table
-.label.en MorePreferedCar
+.key select.Owner.MorePreferredCar/equanda-table
+.label.en MorePreferredCar
.key select.Owner.Name/equanda-table
.label.en Name
-.key select.Owner.SinglePreferedCar/equanda-table
-.label.en SinglePreferedCar
+.key select.Owner.SinglePreferredCar/equanda-table
+.label.en SinglePreferredCar
.key select.Owner.EquandaAll/equanda-table
.label.en equandaAll
.key select.Owner.EquandaNamePart/equanda-table
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java 2009-03-27 20:28:17 UTC (rev 1069)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java 2009-03-28 14:15:28 UTC (rev 1070)
@@ -137,7 +137,7 @@
Car mercedes = Car.equandaCreate();
mercedes.setBrand( "mercedes" + System.currentTimeMillis() );
mercedes.equandaUpdate();
- george.setPreferedCar( mercedes );
+ george.setPreferredCar( mercedes );
george.equandaUpdate();
mercedes.equandaUpdate(); // need to update as it has changed (thanks to change in george)
mercedes.getFans().add( mike );
@@ -153,7 +153,7 @@
}
mercedes.equandaUpdate();
george.equandaUpdate();
- assertNull( george.getPreferedCar() );
+ assertNull( george.getPreferredCar() );
}
public void testNotOwnerLink()
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java 2009-03-27 20:28:17 UTC (rev 1069)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java 2009-03-28 14:15:28 UTC (rev 1070)
@@ -128,7 +128,7 @@
base.equandaUpdate();
Owner ownerBase = Owner.equandaCreate();
ownerBase.setName( OWNER_NAME + '2' );
- ownerBase.setPreferedCar( base );
+ ownerBase.setPreferredCar( base );
ownerBase.equandaUpdate();
CarSelectorEJB sel = EquandaGlobal.getCarSelector();
@@ -184,14 +184,14 @@
Owner owner = Owner.equandaCreate();
owner.setName( name );
- owner.setPreferedCar( car );
+ owner.setPreferredCar( car );
owner.equandaUpdate();
OwnerSelectorEJB sel = EquandaGlobal.getOwnerSelector();
CarSelectorEJB selCar = EquandaGlobal.getCarSelector();
owner = sel.selectName( name );
assertEquals( name, owner.getName() );
- car = owner.getPreferedCar();
+ car = owner.getPreferredCar();
assertNotNull( car );
assertEquals( CAR_BRAND, car.getBrand() );
@@ -338,22 +338,22 @@
Owner owner = Owner.equandaCreate();
owner.setName( name );
- owner.setPreferedCar( car );
+ owner.setPreferredCar( car );
owner.equandaUpdate();
- car = owner.getPreferedCar();
+ car = owner.getPreferredCar();
assertNotNull( car );
car.setExtra( "extra" );
assertTrue( car.isModified() );
assertTrue( owner.isModified() );
owner.equandaUpdate();
- car = owner.getPreferedCar();
+ car = owner.getPreferredCar();
assertNotNull( car );
assertFalse( owner.isModified() );
assertFalse( car.isModified() );
- owner.getPreferedCar().removeEntityBean();
+ owner.getPreferredCar().removeEntityBean();
owner.removeEntityBean();
}
@@ -369,9 +369,9 @@
owner.equandaUpdate();
// check the update of a single link
- owner.setPreferedCar( car1 );
+ owner.setPreferredCar( car1 );
owner.equandaUpdate();
- assertNotNull( owner.getPreferedCar() );
+ assertNotNull( owner.getPreferredCar() );
// check the update of a multiple link
Collection<Car> col = new ArrayList<Car>();
@@ -381,30 +381,30 @@
assertFalse( owner.getCarsWichHeLikes().isEmpty() );
// check the update of a field in the link
- owner.getPreferedCar().setExtra( "Extra" );
+ owner.getPreferredCar().setExtra( "Extra" );
owner.equandaUpdate();
- assertEquals( owner.getPreferedCar().getExtra(), "Extra" );
+ assertEquals( owner.getPreferredCar().getExtra(), "Extra" );
// check removal of links
- Car preferedCar = owner.getPreferedCar();
- owner.setPreferedCar( null );
+ Car preferredCar = owner.getPreferredCar();
+ owner.setPreferredCar( null );
Car oneOfTheCarsHeLikes = owner.getCarsWichHeLikes().iterator().next();
owner.setCarsWichHeLikes( null );
owner.equandaUpdate();
- assertNull( owner.getPreferedCar() );
+ assertNull( owner.getPreferredCar() );
assertTrue( owner.getCarsWichHeLikes().isEmpty() );
// check for infinite updates
- owner.setPreferedCar( preferedCar );
+ owner.setPreferredCar( preferredCar );
ArrayList<Owner> owners = new ArrayList<Owner>();
owners.add( owner );
- preferedCar.setOwners( owners );
+ preferredCar.setOwners( owners );
owner.equandaUpdate();
- assertNotNull( owner.getPreferedCar() );
- assertEquals( 1, preferedCar.getOwners().size() );
+ assertNotNull( owner.getPreferredCar() );
+ assertEquals( 1, preferredCar.getOwners().size() );
// clean up
- owner.getPreferedCar().removeEntityBean();
+ owner.getPreferredCar().removeEntityBean();
oneOfTheCarsHeLikes.removeEntityBean();
owner.removeEntityBean();
}
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/RemoveLinksTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/RemoveLinksTest.java 2009-03-27 20:28:17 UTC (rev 1069)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/RemoveLinksTest.java 2009-03-28 14:15:28 UTC (rev 1070)
@@ -83,7 +83,8 @@
owner1.setName( OWNER_NAME_1 );
Car car1 = Car.equandaCreate();
car1.setBrand( CAR_1_BRAND );
- owner1.setPreferedCar( car1 );
+ car1.equandaUpdate();
+ owner1.setPreferredCar( car1 );
owner1.equandaUpdate();
assertNotNull( selOwner.selectName( OWNER_NAME_1 ) );
@@ -146,7 +147,8 @@
Car car1 = Car.equandaCreate();
car1.setBrand( CAR_1_BRAND );
- owner1.setPreferedCar( car1 );
+ car1.equandaUpdate();
+ owner1.setPreferredCar( car1 );
owner1.equandaUpdate();
assertNotNull( selOwner.selectName( OWNER_NAME_1 ) );
@@ -165,7 +167,8 @@
car1 = Car.equandaCreate();
car1.setBrand( CAR_1_BRAND );
- owner1.setPreferedCar( car1 );
+ car1.equandaUpdate();
+ owner1.setPreferredCar( car1 );
owner1.equandaUpdate();
assertNotNull( selOwner.selectName( OWNER_NAME_2 ) );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-27 20:28:20
|
Revision: 1069
http://equanda.svn.sourceforge.net/equanda/?rev=1069&view=rev
Author: triathlon98
Date: 2009-03-27 20:28:17 +0000 (Fri, 27 Mar 2009)
Log Message:
-----------
fix two action tests (to 57/23)
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ActionTest.java
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2009-03-27 17:11:55 UTC (rev 1068)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2009-03-27 20:28:17 UTC (rev 1069)
@@ -434,7 +434,7 @@
if ( update ) equandaUpdate();
if ( proxy.id == null )
{
- throw new EquandaException();
+ throw new EquandaException( ExceptionCodes.EPE_NULL_UOID_INVALID );
}
${table.Name}SelectorEJB sel = null;
try
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ActionTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ActionTest.java 2009-03-27 17:11:55 UTC (rev 1068)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ActionTest.java 2009-03-27 20:28:17 UTC (rev 1069)
@@ -41,6 +41,7 @@
{
assertTrue( true );
Action obj = Action.equandaCreate();
+ obj.equandaUpdate();
int res = obj.hashCode( "hello !!!" );
assertEquals( "hello !!!".hashCode(), res );
}
@@ -51,6 +52,7 @@
ActionSelectorEJB sel = EquandaGlobal.getActionSelector();
Action obj = Action.equandaCreate();
obj.setTheInt( 55 );
+ obj.equandaUpdate();
int res = sel.singleIntHashCode( 55, "hello !!!");
assertEquals( "hello !!!".hashCode(), res );
}
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java 2009-03-27 17:11:55 UTC (rev 1068)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java 2009-03-27 20:28:17 UTC (rev 1069)
@@ -66,7 +66,9 @@
mercedes.equandaUpdate();
bmw.getOwners().clear();
bmw.equandaUpdate();
+ nick.equandaUpdate(); // update to refresh data
assertEquals( "nick's number of cars should be 0", 0, nick.getCars().size() );
+ paul.equandaUpdate(); // update to refresh data
assertEquals( "paul's number of cars should be 0", 0, paul.getCars().size() );
assertEquals( "mercedes's number of owners should be 0", 0, mercedes.getOwners().size() );
assertEquals( "bmw's number of owners should be 0", 0, bmw.getOwners().size() );
@@ -78,7 +80,9 @@
paul.equandaUpdate();
assertEquals( "nick's number of cars should be 2", 2, nick.getCars().size() );
assertEquals( "paul's number of cars should be 1", 1, paul.getCars().size() );
+ mercedes.equandaUpdate(); // update to refresh data
assertEquals( "mercedes's number of owners should be 2", 2, mercedes.getOwners().size() );
+ bmw.equandaUpdate(); // update to refresh data
assertEquals( "bmw's number of owners should be 1", 1, bmw.getOwners().size() );
nick.getCars().clear();
nick.equandaUpdate();
@@ -86,7 +90,9 @@
paul.equandaUpdate();
assertEquals( "nick's number of cars should be 0", 0, nick.getCars().size() );
assertEquals( "paul's number of cars should be 0", 0, paul.getCars().size() );
+ mercedes.equandaUpdate(); // update to refresh data
assertEquals( "mercedes's number of owners should be 0", 0, mercedes.getOwners().size() );
+ bmw.equandaUpdate(); // update to refresh data
assertEquals( "bmw's number of owners should be 0", 0, bmw.getOwners().size() );
}
@@ -133,6 +139,7 @@
mercedes.equandaUpdate();
george.setPreferedCar( mercedes );
george.equandaUpdate();
+ mercedes.equandaUpdate(); // need to update as it has changed (thanks to change in george)
mercedes.getFans().add( mike );
mercedes.equandaUpdate();
assertEquals( "number of fans should be 2", 2, mercedes.getFans().size() );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-27 17:12:41
|
Revision: 1068
http://equanda.svn.sourceforge.net/equanda/?rev=1068&view=rev
Author: triathlon98
Date: 2009-03-27 17:11:55 +0000 (Fri, 27 Mar 2009)
Log Message:
-----------
EQ-335 fix when session is invalidated
Modified Paths:
--------------
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/T5guiModule.java
Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/T5guiModule.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/T5guiModule.java 2009-03-27 15:37:06 UTC (rev 1067)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/T5guiModule.java 2009-03-27 17:11:55 UTC (rev 1068)
@@ -42,8 +42,6 @@
import org.equanda.t5gui.translators.UoidTranslator;
import org.slf4j.Logger;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.Date;
@@ -161,11 +159,9 @@
* yet exist (which is possible when logging in using some SSO solution, then the user should be created).
*
* @param log log
- * @param requestGlobals request globals for session access
* @return request filter
*/
- public static RequestFilter buildSelectorsStateFilter( final Logger log,
- final RequestGlobals requestGlobals )
+ public static RequestFilter buildSelectorsStateFilter( final Logger log )
{
return new RequestFilter()
{
@@ -175,9 +171,9 @@
// assure we have a user object, make it available on the session, login and set locale
log.debug( "SelectorsStateFilter invoked" );
- HttpServletRequest servletRequest = requestGlobals.getHTTPServletRequest();
- HttpSession session = servletRequest.getSession();
- SelectorsStateType sst = (SelectorsStateType) session.getAttribute( SESSION_SELECTORSSTATE );
+ Session session = request.getSession( false );
+ SelectorsStateType sst = null;
+ if ( null != session ) sst = (SelectorsStateType) session.getAttribute( SESSION_SELECTORSSTATE );
log.debug( "getting selectorsstate from session " + sst );
if ( null != sst )
{
@@ -195,7 +191,7 @@
{
// now store the SelectorsState back into the session
sst = SelectorsState.getSelectorsState();
- if ( null != sst )
+ if ( null != sst && null != session && !session.isInvalidated() )
{
log.debug( "storing selectorsstate in session " + sst );
session.setAttribute( SESSION_SELECTORSSTATE, sst );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-27 15:37:35
|
Revision: 1067
http://equanda.svn.sourceforge.net/equanda/?rev=1067&view=rev
Author: triathlon98
Date: 2009-03-27 15:37:06 +0000 (Fri, 27 Mar 2009)
Log Message:
-----------
fix disfunctional tests, of 253 tests now 58/24 fail/error or 82 to go...
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CloneableTest.java
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/MultipleFieldTest.java
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2009-03-27 13:52:36 UTC (rev 1066)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2009-03-27 15:37:06 UTC (rev 1067)
@@ -72,7 +72,8 @@
{
${table.Name} clone = new ${table.Name}(
new Equanda${table.Name}State( cloneUoid ? id : null, equandaType.getType(),
- proxy.equandaCreationDate, equandaModificationDate, equandaVersion )
+ cloneUoid ? proxy.equandaCreationDate : new java.sql.Timestamp( System.currentTimeMillis() ),
+ equandaModificationDate, cloneUoid ? equandaVersion : 0 )
);
// clone fields
#foreach( $field in $table.FieldsNotInternal )
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-27 13:52:36 UTC (rev 1066)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-27 15:37:06 UTC (rev 1067)
@@ -470,8 +470,10 @@
$action.ParametersListWithTypes
#end
) throws EquandaException {
- DM${table.Name} entity = HR${table.Name}.equandaRunQuery( entityManager,
- equandaSelect${select.Name}( $select.ParametersListSingleSelect ) ).get( 0 );
+ List<DM${table.Name}> entities = HR${table.Name}.equandaRunQuery( entityManager,
+ equandaSelect${select.Name}( $select.ParametersListSingleSelect ) );
+ if ( entities.isEmpty() ) throw new EquandaException( EE_OBJECT_NOT_FOUND );
+ DM${table.Name} entity = entities.get( 0 );
HT${table.Name}Root helper = getTableHelper( entity );
#if( $action.Return!="void" )return #end helper.${action.Name}( entity
#if( $action.Parameters.size() > 0 )
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CloneableTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CloneableTest.java 2009-03-27 13:52:36 UTC (rev 1066)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CloneableTest.java 2009-03-27 15:37:06 UTC (rev 1067)
@@ -24,6 +24,10 @@
package org.equanda.test.xejb;
+import org.equanda.test.dm.client.Cloneable;
+import org.equanda.test.dm.client.CloneableSelectorEJB;
+import org.equanda.test.dm.client.EquandaGlobal;
+
/**
* JUnit to test cloning of objects
*
@@ -35,21 +39,17 @@
public void testCloneable()
throws Exception
{
- assertTrue( false );
- /* // @todo re-enable
- CloneableEJB obj = EquandaGlobal.getCloneable();
- obj.init();
+ Cloneable obj = Cloneable.equandaCreate();
obj.setTestStringCloneable( "aaa" );
obj.setTestStringNotCloneable( "bbb" );
- CloneableEJB clone = EquandaGlobal.getCloneable();
- clone.equandaClone( " ", obj );
+ obj.equandaUpdate();
+ Cloneable clone = obj.equandaClone( false );
assertEquals( "clone.TestStringCloneable should be \"aaa\"", "aaa", clone.getTestStringCloneable() );
assertNull( "clone.TestStringNotCloneable should be null", clone.getTestStringNotCloneable() );
CloneableSelectorEJB objSelector = EquandaGlobal.getCloneableSelector();
- org.equanda.test.dm.client.Cloneable cloneVal = objSelector.equandaClone( " ", obj.getId() );
+ Cloneable cloneVal = objSelector.equandaClone( " ", obj.getId() );
assertTrue( "cloneVal.TestStringCloneable should be \"aaa\"",
cloneVal.getTestStringCloneable().equals( "aaa" ) );
assertNull( "cloneVal.TestStringNotCloneable should be null", cloneVal.getTestStringNotCloneable() );
- */
}
}
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java 2009-03-27 13:52:36 UTC (rev 1066)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java 2009-03-27 15:37:06 UTC (rev 1067)
@@ -39,7 +39,6 @@
public void testNNLink()
throws Exception
{
- assertTrue( false ); // @todo test is dysfunctional
int version = (int) System.currentTimeMillis();
Owner nick = Owner.equandaCreate();
nick.setName( "nick" + version );
@@ -63,9 +62,10 @@
assertEquals( "paul's number of cars should be 1", 1, paul.getCars().size() );
assertEquals( "mercedes's number of owners should be 2", 2, mercedes.getOwners().size() );
assertEquals( "bmw's number of owners should be 1", 1, bmw.getOwners().size() );
- //mercedes.removeEquandaLinkOwner( nick.getId() ); // @todo re-enable
- //mercedes.removeEquandaLinkOwner( paul.getId() ); // @todo re-enable
- //bmw.removeEquandaLinkOwner( nick.getId() ); // @todo re-enable
+ mercedes.getOwners().clear();
+ mercedes.equandaUpdate();
+ bmw.getOwners().clear();
+ bmw.equandaUpdate();
assertEquals( "nick's number of cars should be 0", 0, nick.getCars().size() );
assertEquals( "paul's number of cars should be 0", 0, paul.getCars().size() );
assertEquals( "mercedes's number of owners should be 0", 0, mercedes.getOwners().size() );
@@ -80,9 +80,10 @@
assertEquals( "paul's number of cars should be 1", 1, paul.getCars().size() );
assertEquals( "mercedes's number of owners should be 2", 2, mercedes.getOwners().size() );
assertEquals( "bmw's number of owners should be 1", 1, bmw.getOwners().size() );
- //nick.removeEquandaLinkCar( mercedes.getId() ); // @todo re-enable
- //nick.removeEquandaLinkCar( bmw.getId() ); // @todo re-enable
- //paul.removeEquandaLinkCar( mercedes.getId() ); // @todo re-enable
+ nick.getCars().clear();
+ nick.equandaUpdate();
+ paul.getCars().clear();
+ paul.equandaUpdate();
assertEquals( "nick's number of cars should be 0", 0, nick.getCars().size() );
assertEquals( "paul's number of cars should be 0", 0, paul.getCars().size() );
assertEquals( "mercedes's number of owners should be 0", 0, mercedes.getOwners().size() );
@@ -123,7 +124,6 @@
public void test1NLink()
throws Exception
{
- assertTrue( false ); // @todo test is dysfunctional
Owner george = Owner.equandaCreate();
george.equandaUpdate();
Owner mike = Owner.equandaCreate();
@@ -136,7 +136,16 @@
mercedes.getFans().add( mike );
mercedes.equandaUpdate();
assertEquals( "number of fans should be 2", 2, mercedes.getFans().size() );
- //mercedes.removeEquandaLinkFan( george.getId() ); // @todo re-enable
+ for ( Owner fan : mercedes.getFans() )
+ {
+ if ( fan.getId().equals( george.getId() ) )
+ {
+ mercedes.getFans().remove( fan );
+ break;
+ }
+ }
+ mercedes.equandaUpdate();
+ george.equandaUpdate();
assertNull( george.getPreferedCar() );
}
@@ -165,8 +174,7 @@
fail( "the set should not be accepted" );
}
catch ( Exception e )
- {
- }
+ {/*expected*/}
// try to make the set through a multiple field (other side is single)
try
{
@@ -175,8 +183,7 @@
fail( "the add should not be accepted" );
}
catch ( Exception e )
- {
- }
+ {/*expected*/}
// try to make the set through a multiple field (other side is multiple)
try
{
@@ -185,7 +192,7 @@
fail( "the add should not be accepted" );
}
catch ( Exception e )
- {}
+ {/*expected*/}
r2.getCallLinkableFacade2().add( l );
r2.equandaUpdate();
@@ -196,7 +203,6 @@
fail( "the remove should not be accepted" );
}
catch ( Exception e )
- {
- }
+ {/*expected*/}
}
}
\ No newline at end of file
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/MultipleFieldTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/MultipleFieldTest.java 2009-03-27 13:52:36 UTC (rev 1066)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/MultipleFieldTest.java 2009-03-27 15:37:06 UTC (rev 1067)
@@ -109,93 +109,102 @@
}
private CocoonMan setMultipleFieldCheck( CocoonMan obj, Collection<Car> carsToset,
- boolean skipTests )
+ boolean skipTests )
throws Exception
{
return setMultipleFieldCheck( obj, carsToset, null, skipTests, false );
}
private CocoonMan setMultipleFieldCheck( CocoonMan obj, Collection<Car> carsToset,
- Collection<Car> carsToset2,
- boolean skipTests, boolean multipleSets )
+ Collection<Car> carsToset2,
+ boolean skipTests, boolean multipleSets )
throws Exception
{
- assertTrue( false ); // @todo test is dysfunctional
- obj.equandaUpdate();
+ CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
+ try
+ {
+ obj.equandaUpdate();
- // check multiple string
- Collection<String> jobs = new ArrayList<String>();
- jobs.add( "job1" );
- jobs.add( "job2" );
- jobs.add( "job3" );
+ // check multiple string
+ Collection<String> jobs = new ArrayList<String>();
+ jobs.add( "job1" );
+ jobs.add( "job2" );
+ jobs.add( "job3" );
- obj.setPreviousJobs( jobs );
- if ( multipleSets )
- {
- Collection<String> jobs2 = new ArrayList<String>();
- jobs2.add( "job1" );
- jobs2.add( "job2" );
- jobs2.add( "job3" );
- obj.setPreviousJobs( jobs2 );
- }
- obj.equandaUpdate();
- if ( skipTests )
- {
- // now check the obj
- assertEquals( "String multiple field was not saved! ", 3, obj.getPreviousJobs().size() );
- // now do the check with the selector (just to make sure)
- //assertEquals( "String multiple field was not saved! ", 3, // @todo re-enable
- // sel.getEquandaPreviousJobs( obj.getId() ).size() );
- }
+ obj.setPreviousJobs( jobs );
+ if ( multipleSets )
+ {
+ Collection<String> jobs2 = new ArrayList<String>();
+ jobs2.add( "job1" );
+ jobs2.add( "job2" );
+ jobs2.add( "job3" );
+ obj.setPreviousJobs( jobs2 );
+ }
+ obj.equandaUpdate();
+ if ( skipTests )
+ {
+ // now check the obj
+ assertEquals( "String multiple field was not saved! ", 3, obj.getPreviousJobs().size() );
+ // now do the check with the selector (just to make sure)
+ assertEquals( "String multiple field was not saved! ", 3,
+ sel.getEquandaPreviousJobs( obj.getId() ).size() );
+ }
- // check multiple date
- Collection<Date> dates = new ArrayList<Date>();
- dates.add( new Date( 2005, 1, 1 ) );
- dates.add( new Date( 2005, 1, 5 ) );
+ // check multiple date
+ Collection<Date> dates = new ArrayList<Date>();
+ dates.add( new Date( 2005, 1, 1 ) );
+ dates.add( new Date( 2005, 1, 5 ) );
- obj.setDatesToRemember( dates );
- if ( multipleSets )
- {
- Collection<Date> dates2 = new ArrayList<Date>();
- dates2.add( new Date( 2005, 1, 1 ) );
- dates2.add( new Date( 2005, 1, 5 ) );
- obj.setDatesToRemember( dates2 );
- }
- obj.equandaUpdate();
- if ( skipTests )
- {
- // now check the obj
- assertEquals( "Date multiple field was not saved! ", 2, obj.getDatesToRemember().size() );
- // now do the check with the selector (just to make sure)
- //assertEquals( "Date multiple field was not saved! ", 2, // @todo re-enable
- // sel.getEquandaDatesToRemember( obj.getId() ).size() );
- }
+ obj.setDatesToRemember( dates );
+ if ( multipleSets )
+ {
+ Collection<Date> dates2 = new ArrayList<Date>();
+ dates2.add( new Date( 2005, 1, 1 ) );
+ dates2.add( new Date( 2005, 1, 5 ) );
+ obj.setDatesToRemember( dates2 );
+ }
+ obj.equandaUpdate();
+ if ( skipTests )
+ {
+ // now check the obj
+ assertEquals( "Date multiple field was not saved! ", 2, obj.getDatesToRemember().size() );
+ // now do the check with the selector (just to make sure)
+ assertEquals( "Date multiple field was not saved! ", 2,
+ sel.getEquandaDatesToRemember( obj.getId() ).size() );
+ }
- // check multiple link
- int size = carsToset.size();
- obj.setManyCars( carsToset );
- if ( multipleSets && carsToset2 != null )
- {
- obj.setManyCars( carsToset2 );
+ // check multiple link
+ int size = carsToset.size();
+ obj.setManyCars( carsToset );
+ if ( multipleSets && carsToset2 != null )
+ {
+ obj.setManyCars( carsToset2 );
+ }
+ obj.equandaUpdate();
+ if ( skipTests )
+ {
+ // now check the obj
+ assertEquals( "Link multiple field was not saved! ", size, obj.getManyCars().size() );
+ // now do the check with the selector (just to make sure)
+ assertEquals( "Link multiple field was not saved! ", size,
+ sel.getEquandaManyCars( obj.getId() ).size() );
+ }
+
+ return obj;
}
- obj.equandaUpdate();
- if ( skipTests )
+ finally
{
- // now check the obj
- assertEquals( "Link multiple field was not saved! ", size, obj.getManyCars().size() );
- // now do the check with the selector (just to make sure)
- //assertEquals( "Link multiple field was not saved! ", size, // @todo re-enable
- // sel.getEquandaManyCars( obj.getId() ).size() );
+ sel.remove();
}
-
- return obj;
}
private CocoonMan modifyMultipleFieldCheck( CocoonMan obj, Collection<Car> carsToset )
throws Exception
{
- assertTrue( false ); // @todo test is dysfunctional
- obj.equandaUpdate();
+ CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
+ try
+ {
+ obj.equandaUpdate();
obj = setMultipleFieldCheck( obj, carsToset, true );
// @ remove then add an element
@@ -212,8 +221,8 @@
assertEquals( "Value from the multiple string field was not removed! ", jobsSize,
obj.getPreviousJobs().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Value from the multiple string field was not removed! ", jobsSize, // @todo re-enable
- // sel.getEquandaPreviousJobs( obj.getId() ).size() );
+ assertEquals( "Value from the multiple string field was not removed! ", jobsSize,
+ sel.getEquandaPreviousJobs( obj.getId() ).size() );
// add
jobs = new ArrayList<String>( obj.getPreviousJobs() );
jobs.add( job );
@@ -223,8 +232,8 @@
// now check the obj
assertEquals( "Value from the multiple string field was not added! ", jobsSize, obj.getPreviousJobs().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Value from the multiple string field was not added! ", jobsSize, // @todo re-enable
- // sel.getEquandaPreviousJobs( obj.getId() ).size() );
+ assertEquals( "Value from the multiple string field was not added! ", jobsSize,
+ sel.getEquandaPreviousJobs( obj.getId() ).size() );
// for dates
// remove
@@ -238,8 +247,8 @@
assertEquals( "Value from the multiple date field was not removed! ", datesSize,
obj.getDatesToRemember().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Value from the multiple date field was not removed! ", datesSize, // @todo re-enable
- // sel.getEquandaDatesToRemember( obj.getId() ).size() );
+ assertEquals( "Value from the multiple date field was not removed! ", datesSize,
+ sel.getEquandaDatesToRemember( obj.getId() ).size() );
// add
dates = new ArrayList<Date>( obj.getDatesToRemember() );
dates.add( date );
@@ -250,8 +259,8 @@
assertEquals( "Value from the multiple date field was not added! ", datesSize,
obj.getDatesToRemember().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Value from the multiple date field was not added! ", datesSize, // @todo re-enable
- // sel.getEquandaDatesToRemember( obj.getId() ).size() );
+ assertEquals( "Value from the multiple date field was not added! ", datesSize,
+ sel.getEquandaDatesToRemember( obj.getId() ).size() );
// for links
// remove
@@ -264,8 +273,8 @@
// now check the obj
assertEquals( "Value from the multiple link field was not removed! ", carsSize, obj.getManyCars().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Value from the multiple link field was not removed! ", carsSize, // @todo re-enable
- // sel.getEquandaManyCars( obj.getId() ).size() );
+ assertEquals( "Value from the multiple link field was not removed! ", carsSize,
+ sel.getEquandaManyCars( obj.getId() ).size() );
// add
cars = new ArrayList<Car>( obj.getManyCars() );
cars.add( car );
@@ -275,17 +284,20 @@
// now check the obj
assertEquals( "Value from the multiple link field was not added! ", carsSize, obj.getManyCars().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Value from the multiple link field was not added! ", carsSize, // @todo re-enable
- // sel.getEquandaManyCars( obj.getId() ).size() );
+ assertEquals( "Value from the multiple link field was not added! ", carsSize,
+ sel.getEquandaManyCars( obj.getId() ).size() );
return obj;
+ }
+ finally
+ {
+ sel.remove();
+ }
}
private CocoonMan modifyMultipleFieldCheck2( CocoonMan obj, Collection<Car> carsToset )
throws Exception
{
- assertTrue( false ); // @todo test is dysfunctional
-
CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
obj.equandaUpdate();
obj = setMultipleFieldCheck( obj, carsToset, true );
@@ -307,13 +319,13 @@
// now check the obj
assertEquals( "Value from the multiple string field was not added! ", jobsSize, obj.getPreviousJobs().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Value from the multiple string field was not added! ", jobsSize, // @todo re-enable
- // sel.getEquandaPreviousJobs( obj.getId() ).size() );
+ assertEquals( "Value from the multiple string field was not added! ", jobsSize,
+ sel.getEquandaPreviousJobs( obj.getId() ).size() );
// now check the values
for ( String job : matchingJobs )
{
- //assertTrue( "Incorrect saved values - multiple string field! ", // @todo re-enable
- // sel.getEquandaPreviousJobs( obj.getId() ).contains( job ) );
+ assertTrue( "Incorrect saved values - multiple string field! ",
+ sel.getEquandaPreviousJobs( obj.getId() ).contains( job ) );
}
// for dates
@@ -333,13 +345,13 @@
assertEquals( "Value from the multiple date field was not added! ", datesSize,
obj.getDatesToRemember().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Value from the multiple date field was not added! ", datesSize, // @todo re-enable
- // sel.getEquandaDatesToRemember( obj.getId() ).size() );
+ assertEquals( "Value from the multiple date field was not added! ", datesSize,
+ sel.getEquandaDatesToRemember( obj.getId() ).size() );
// now check the values
- /*for ( Date date : sel.getEquandaDatesToRemember( obj.getId() ) ) // @todo re-enable
+ for ( Date date : sel.getEquandaDatesToRemember( obj.getId() ) )
{
assertTrue( "Incorrect saved values - multiple date field! ", matchingDates.contains( date ) );
- }*/
+ }
// for links
// remove
@@ -352,8 +364,8 @@
// now check the obj
assertEquals( "Value from the multiple link field was not removed! ", carsSize, obj.getManyCars().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Value from the multiple link field was not removed! ", carsSize, // @todo re-enable
- // sel.getEquandaManyCars( obj.getId() ).size() );
+ assertEquals( "Value from the multiple link field was not removed! ", carsSize,
+ sel.getEquandaManyCars( obj.getId() ).size() );
// add
cars = new ArrayList<Car>( obj.getManyCars() );
ArrayList<Car> matchigCars = new ArrayList<Car>( cars );
@@ -369,20 +381,20 @@
// now check the obj
assertEquals( "Value from the multiple link field was not added! ", carsSize, obj.getManyCars().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Value from the multiple link field was not added! ", carsSize, // @todo re-enable
- // sel.getEquandaManyCars( obj.getId() ).size() );
+ assertEquals( "Value from the multiple link field was not added! ", carsSize,
+ sel.getEquandaManyCars( obj.getId() ).size() );
// now check the values
for ( Car matchCar : matchigCars )
{
boolean found = false;
- /*for ( Car car : sel.getEquandaManyCars( obj.getId() ) ) // @todo re-enable
+ for ( Car car : sel.getEquandaManyCars( obj.getId() ) )
{
if ( car.getId().equals( matchCar.getId() ) )
{
found = true;
break;
}
- } */
+ }
assertTrue( "Incorrect saved value - multiple link field! ", found );
}
@@ -392,8 +404,6 @@
private CocoonMan addNullToMultipleFieldCheck( CocoonMan obj, Collection<Car> carsToset, boolean shouldFail )
throws Exception
{
- assertTrue( false ); // @todo test is dysfunctional
-
CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
obj.equandaUpdate();
obj = setMultipleFieldCheck( obj, carsToset, true );
@@ -421,8 +431,8 @@
assertEquals( "Adding a null element to a multipe string field should not be possible! ", prevSize,
obj.getPreviousJobs().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Adding a null element to a multipe string field should not be possible! ", prevSize, // @todo re-enable
- // sel.getEquandaPreviousJobs( obj.getId() ).size() );
+ assertEquals( "Adding a null element to a multipe string field should not be possible! ", prevSize,
+ sel.getEquandaPreviousJobs( obj.getId() ).size() );
// for dates
ArrayList<Date> dates = new ArrayList<Date>( obj.getDatesToRemember() );
@@ -444,8 +454,8 @@
assertEquals( "Adding a null element to a multipe date field should not be possible! ", prevSize,
obj.getDatesToRemember().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Adding a null element to a multipe date field should not be possible! ", prevSize, // @todo re-enable
- // sel.getEquandaDatesToRemember( obj.getId() ).size() );
+ assertEquals( "Adding a null element to a multipe date field should not be possible! ", prevSize,
+ sel.getEquandaDatesToRemember( obj.getId() ).size() );
// for links
ArrayList<Car> cars = new ArrayList<Car>( obj.getManyCars() );
@@ -467,8 +477,8 @@
assertEquals( "Adding a null element to a multipe link field should not be possible! ", prevSize,
obj.getManyCars().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "Adding a null element to a multipe link field should not be possible! ", prevSize, // @todo re-enable
- // sel.getEquandaManyCars( obj.getId() ).size() );
+ assertEquals( "Adding a null element to a multipe link field should not be possible! ", prevSize,
+ sel.getEquandaManyCars( obj.getId() ).size() );
return obj;
}
@@ -476,8 +486,6 @@
private CocoonMan clearMultipleFieldWithNewCollCheck( CocoonMan obj, Collection<Car> carsToset )
throws Exception
{
- assertTrue( false ); // @todo test is dysfunctional
-
CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
obj.equandaUpdate();
obj = setMultipleFieldCheck( obj, carsToset, true );
@@ -490,8 +498,8 @@
// now check the obj
assertEquals( "The multiple string field was not cleared! ", 0, obj.getPreviousJobs().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "The multiple string field was not cleared! ", 0, // @todo re-enable
- // sel.getEquandaPreviousJobs( obj.getId() ).size() );
+ assertEquals( "The multiple string field was not cleared! ", 0,
+ sel.getEquandaPreviousJobs( obj.getId() ).size() );
// for dates
obj.setDatesToRemember( new ArrayList<Date>() );
@@ -499,8 +507,8 @@
// now check the obj
assertEquals( "The multiple date field was not cleared! ", 0, obj.getDatesToRemember().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "The multiple date field was not cleared! ", 0, // @todo re-enable
- // sel.getEquandaDatesToRemember( obj.getId() ).size() );
+ assertEquals( "The multiple date field was not cleared! ", 0,
+ sel.getEquandaDatesToRemember( obj.getId() ).size() );
// for links
obj.setManyCars( new ArrayList<Car>() );
@@ -508,8 +516,8 @@
// now check the obj
assertEquals( "The multiple string link was not cleared! ", 0, obj.getManyCars().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "The multiple string link was not cleared! ", 0, // @todo re-enable
- // sel.getEquandaManyCars( obj.getId() ).size() );
+ assertEquals( "The multiple string link was not cleared! ", 0,
+ sel.getEquandaManyCars( obj.getId() ).size() );
return obj;
}
@@ -517,8 +525,6 @@
private CocoonMan clearMultipleFieldWithNullCheck( CocoonMan obj, Collection<Car> carsToset )
throws Exception
{
- assertTrue( false ); // @todo test is dysfunctional
-
CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
obj.equandaUpdate();
obj = setMultipleFieldCheck( obj, carsToset, true );
@@ -531,8 +537,8 @@
// now check the obj
assertEquals( "The multiple string field was not cleared! ", 0, obj.getPreviousJobs().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "The multiple string field was not cleared! ", 0, // @todo re-enable
- // sel.getEquandaPreviousJobs( obj.getId() ).size() );
+ assertEquals( "The multiple string field was not cleared! ", 0,
+ sel.getEquandaPreviousJobs( obj.getId() ).size() );
// for dates
obj.setDatesToRemember( null );
@@ -540,8 +546,8 @@
// now check the obj
assertEquals( "The multiple date field was not cleared! ", 0, obj.getDatesToRemember().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "The multiple date field was not cleared! ", 0, // @todo re-enable
- // sel.getEquandaDatesToRemember( obj.getId() ).size() );
+ assertEquals( "The multiple date field was not cleared! ", 0,
+ sel.getEquandaDatesToRemember( obj.getId() ).size() );
// for links
obj.setManyCars( null );
@@ -549,8 +555,8 @@
// now check the obj
assertEquals( "The multiple string link was not cleared! ", 0, obj.getManyCars().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( "The multiple string link was not cleared! ", 0, // @todo re-enable
- // sel.getEquandaManyCars( obj.getId() ).size() );
+ assertEquals( "The multiple string link was not cleared! ", 0,
+ sel.getEquandaManyCars( obj.getId() ).size() );
return obj;
}
@@ -559,11 +565,9 @@
* if you modify the collection after the set then the modification should not be reflected in the persisted object
*/
private CocoonMan expectedBehaviourWhenSettingOwnCollection( CocoonMan obj,
- Collection<Car> carsToset )
+ Collection<Car> carsToset )
throws Exception
{
- assertTrue( false ); // @todo test is dysfunctional
-
CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
obj.equandaUpdate();
@@ -582,9 +586,9 @@
"Modifing a collection after set should not change the persisted object - for multiple string field! ", 3,
obj.getPreviousJobs().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( // @todo re-enable
- // "Modifing a collection after set should not change the persisted object - for multiple string field! ", 3,
- // sel.getEquandaPreviousJobs( obj.getId() ).size() );
+ assertEquals(
+ "Modifing a collection after set should not change the persisted object - for multiple string field! ", 3,
+ sel.getEquandaPreviousJobs( obj.getId() ).size() );
// now make an update then a set with a different collection(directly - no getter first)
obj.equandaUpdate();
jobs = new ArrayList<String>();
@@ -596,11 +600,11 @@
"Setting a new collection without using the getter should update the object with the new collection - for multiple string field! ",
1, obj.getPreviousJobs().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( // @todo re-enable
- // "Setting a new collection without using the getter should update the object with the new collection - for multiple string field! ",
- // 1, sel.getEquandaPreviousJobs( obj.getId() ).size() );
assertEquals(
"Setting a new collection without using the getter should update the object with the new collection - for multiple string field! ",
+ 1, sel.getEquandaPreviousJobs( obj.getId() ).size() );
+ assertEquals(
+ "Setting a new collection without using the getter should update the object with the new collection - for multiple string field! ",
"job4", obj.getPreviousJobs().iterator().next() );
// check multiple date
@@ -617,9 +621,9 @@
"Modifing a collection after set should not change the persisted object - for multiple date field! ", 2,
obj.getDatesToRemember().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( // @todo re-enable
- // "Modifing a collection after set should not change the persisted object - for multiple date field! ", 2,
- // sel.getEquandaDatesToRemember( obj.getId() ).size() );
+ assertEquals(
+ "Modifing a collection after set should not change the persisted object - for multiple date field! ", 2,
+ sel.getEquandaDatesToRemember( obj.getId() ).size() );
// now make an update then a set with a different collection(directly - no getter first)
obj.equandaUpdate();
dates = new ArrayList<Date>();
@@ -631,9 +635,9 @@
"Setting a new collection without using the getter should update the object with the new collection - for multiple date field! ",
1, obj.getDatesToRemember().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( // @todo re-enable
- // "Setting a new collection without using the getter should update the object with the new collection - for multiple date field! ",
- // 1, sel.getEquandaDatesToRemember( obj.getId() ).size() );
+ assertEquals(
+ "Setting a new collection without using the getter should update the object with the new collection - for multiple date field! ",
+ 1, sel.getEquandaDatesToRemember( obj.getId() ).size() );
// check multiple link
int size = carsToset.size();
@@ -647,9 +651,9 @@
"Modifing a collection after set should not change the persisted object - for multiple link field! ", size,
obj.getManyCars().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( // @todo re-enable
- // "Modifing a collection after set should not change the persisted object - for multiple link field! ", size,
- // sel.getEquandaManyCars( obj.getId() ).size() );
+ assertEquals(
+ "Modifing a collection after set should not change the persisted object - for multiple link field! ", size,
+ sel.getEquandaManyCars( obj.getId() ).size() );
// now make an update then a set with a different collection(directly - no getter first)
obj.equandaUpdate();
Collection<Car> carsToset3 = new ArrayList<Car>( carsToset );
@@ -661,9 +665,9 @@
"Setting a new collection without using the getter should update the object with the new collection - for multiple link field! ",
size - 1, obj.getManyCars().size() );
// now do the check with the selector (just to make sure)
- //assertEquals( // @todo re-enable
- // "Setting a new collection without using the getter should update the object with the new collection - for multiple link field! ",
- // size - 1, sel.getEquandaManyCars( obj.getId() ).size() );
+ assertEquals(
+ "Setting a new collection without using the getter should update the object with the new collection - for multiple link field! ",
+ size - 1, sel.getEquandaManyCars( obj.getId() ).size() );
return obj;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-27 13:52:41
|
Revision: 1066
http://equanda.svn.sourceforge.net/equanda/?rev=1066&view=rev
Author: triathlon98
Date: 2009-03-27 13:52:36 +0000 (Fri, 27 Mar 2009)
Log Message:
-----------
more base actions support, enable all tests (incomplete tests now just fail)
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectRoot.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ActionTest.java
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CloneableTest.java
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/MultipleFieldTest.java
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SecurityTest.java
Added Paths:
-----------
branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/HTAction.java
branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/HTSecur.java
Removed Paths:
-------------
branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/ActionMediator.java
branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/SecurMediator.java
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectRoot.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectRoot.java.vm 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectRoot.java.vm 2009-03-27 13:52:36 UTC (rev 1066)
@@ -37,6 +37,7 @@
import ${package}.server.pm.DM${table.Name};
import org.equanda.client.ExceptionCodes;
+import org.equanda.client.EquandaException;
import org.equanda.persistence.EquandaOperationNotAllowed;
/**
@@ -54,7 +55,7 @@
throws EquandaException
{
throw new EquandaOperationNotAllowed( ExceptionCodes.UONA_OPERATION_NOT_ALLOWED,
- "$table.Name, ${action.Name}, "+ entity.getEquandaType() );
+ "$table.Name, ${action.Name}, "+ entity.getClass().getName() );
}
#end
}
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2009-03-27 13:52:36 UTC (rev 1066)
@@ -427,7 +427,6 @@
/**
* $action.Description
*/
-/*
public $action.Return ${action.Name}( $action.ParametersListWithTypes )
throws EquandaException
{
@@ -452,7 +451,6 @@
if ( update ) equandaUpdate();
#if( $action.Return!="void" ) return res; #end
}
-*/
#end
public void equandaUpdate( boolean updateTypeFieldsOnly )
@@ -657,6 +655,5 @@
}
#end
#end
-
}
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-27 13:52:36 UTC (rev 1066)
@@ -426,7 +426,16 @@
return get( entity );
}
+ public HT${table.Name}Root getTableHelper( DM${table.Name} entity )
+ {
+ HT${table.Name}Root helper = null;
+#foreach( $type in $table.TablesNotInternal )
+ if ( entity instanceof DM${type.Name} ) helper = new HT${type.Name}();
+#end
+ return helper;
+ }
+
// actions
#foreach( $action in $table.Actions )
@@ -461,8 +470,9 @@
$action.ParametersListWithTypes
#end
) throws EquandaException {
- ${table.Name}EJB obj = null;
- DM${table.Name} entity = HR${table.Name}.select${select.Name}( entityManager, $select.ParametersListSingleSelect );
+ DM${table.Name} entity = HR${table.Name}.equandaRunQuery( entityManager,
+ equandaSelect${select.Name}( $select.ParametersListSingleSelect ) ).get( 0 );
+ HT${table.Name}Root helper = getTableHelper( entity );
#if( $action.Return!="void" )return #end helper.${action.Name}( entity
#if( $action.Parameters.size() > 0 )
, $action.ParametersList
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini 2009-03-27 13:52:36 UTC (rev 1066)
@@ -31,7 +31,7 @@
output6=${outputDir}${packageDir}client/HR${table}.java
template6=HRObject.java.vm
-output7=${outputDir}${packageDir}server/Ht${table}Root.java
+output7=${outputDir}${packageDir}server/HT${table}Root.java
template7=HTObjectRoot.java.vm
Deleted: branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/ActionMediator.java
===================================================================
--- branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/ActionMediator.java 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/ActionMediator.java 2009-03-27 13:52:36 UTC (rev 1066)
@@ -1,78 +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.test.dm.server;
-
-import org.equanda.client.EquandaException;
-
-import java.sql.Date;
-import java.sql.Timestamp;
-
-/**
- * simple acton for test case
- * mediator object to allow specific functionality depending on object equandaType
- * this class is intended to be modified manually (not overwritten when created)
- * only protected methods should be overwritten, class private methods should not be touched!
- *
- * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- */
-public class ActionMediator
- //extends ActionMediatorBase
-{
- /*
- public int hashCode( String param )
- throws EquandaException
- {
- return param.hashCode();
- }
-
- public void addAction( int amount )
- throws EquandaException
- {
- setTheInt( getTheInt() + amount );
- }
-
- public void voidAction( String param1, int param2 )
- throws EquandaException
- {
- super.setTheString( param1 );
- }
-
- public void suggestValueAction( String param1, int param2, double param3, Date param4, Timestamp param5,
- boolean param6 )
- throws EquandaException
- {
- try
- {
- for ( int i = 0; i < 10 ; i++ )
- {
- Thread.sleep( 1000 );
- System.out.println( i );
- }
- }
- catch ( Exception e )
- {/*ignore*//*}
- }
- */
-}
Copied: branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/HTAction.java (from rev 1037, branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/ActionMediator.java)
===================================================================
--- branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/HTAction.java (rev 0)
+++ branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/HTAction.java 2009-03-27 13:52:36 UTC (rev 1066)
@@ -0,0 +1,79 @@
+/**
+ * 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.test.dm.server;
+
+import org.equanda.client.EquandaException;
+import org.equanda.test.dm.server.pm.DMAction;
+
+import java.sql.Date;
+import java.sql.Timestamp;
+
+/**
+ * simple acton for test case
+ * mediator object to allow specific functionality depending on object equandaType
+ * this class is intended to be modified manually (not overwritten when created)
+ * only protected methods should be overwritten, class private methods should not be touched!
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public class HTAction
+ extends HTActionBase
+{
+ public int hashCode( DMAction entity, String param )
+ throws EquandaException
+ {
+ return param.hashCode();
+ }
+
+ public void addAction( DMAction entity, int amount )
+ throws EquandaException
+ {
+ entity.setTheInt( entity.getTheInt() + amount );
+ }
+
+ public void voidAction( DMAction entity, String param1, int param2 )
+ throws EquandaException
+ {
+ entity.setTheString( param1 );
+ }
+
+ /*
+ public void suggestValueAction( String param1, int param2, double param3, Date param4, Timestamp param5,
+ boolean param6 )
+ throws EquandaException
+ {
+ try
+ {
+ for ( int i = 0; i < 10 ; i++ )
+ {
+ Thread.sleep( 1000 );
+ System.out.println( i );
+ }
+ }
+ catch ( Exception e )
+ {/*ignore*//*}
+ }
+ */
+}
Copied: branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/HTSecur.java (from rev 1037, branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/SecurMediator.java)
===================================================================
--- branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/HTSecur.java (rev 0)
+++ branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/HTSecur.java 2009-03-27 13:52:36 UTC (rev 1066)
@@ -0,0 +1,53 @@
+/**
+ * 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.test.dm.server;
+
+import org.equanda.client.EquandaException;
+import org.equanda.test.dm.server.pm.DMSecur;
+
+/**
+ * Two actions needed for testcase SecurityTest
+ *
+ * mediator object to allow specific functionality depending on object equandaType
+ * this class is intended to be modified manually (not overwritten when created)
+ * only protected methods should be overwritten, class private methods should not be touched!
+ *
+ * @author NetRom team
+ */
+public class HTSecur
+ extends HTSecurBase
+{
+ public int testProc1( DMSecur entity, String param1 )
+ throws EquandaException
+ {
+ return 0;
+ }
+
+ public int testProc2( DMSecur entity, String param1 )
+ throws EquandaException
+ {
+ return 0;
+ }
+}
Deleted: branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/SecurMediator.java
===================================================================
--- branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/SecurMediator.java 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/SecurMediator.java 2009-03-27 13:52:36 UTC (rev 1066)
@@ -1,52 +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.test.dm.server;
-
-import org.equanda.client.EquandaException;
-
-/**
- * Two actions needed for testcase SecurityTest
- *
- * mediator object to allow specific functionality depending on object equandaType
- * this class is intended to be modified manually (not overwritten when created)
- * only protected methods should be overwritten, class private methods should not be touched!
- *
- * @author NetRom team
- */
-public class SecurMediator
- //extends SecurMediatorBase
-{
- public int testProc1( String param1 )
- throws EquandaException
- {
- return 0;
- }
-
- public int testProc2( String param1 )
- throws EquandaException
- {
- return 0;
- }
-}
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ActionTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ActionTest.java 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ActionTest.java 2009-03-27 13:52:36 UTC (rev 1066)
@@ -41,20 +41,17 @@
{
assertTrue( true );
Action obj = Action.equandaCreate();
- //int res = obj.hashCode( "hello !!!" ); // @todo re-enable
- //assertEquals( "hello !!!".hashCode(), res );
+ int res = obj.hashCode( "hello !!!" );
+ assertEquals( "hello !!!".hashCode(), res );
}
public void testSelectorAction()
throws Exception
{
- /* // @todo re-enable
ActionSelectorEJB sel = EquandaGlobal.getActionSelector();
- ActionEJB obj = EquandaGlobal.getAction();
- obj.init();
+ Action obj = Action.equandaCreate();
obj.setTheInt( 55 );
int res = sel.singleIntHashCode( 55, "hello !!!");
assertEquals( "hello !!!".hashCode(), res );
- */
}
}
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CloneableTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CloneableTest.java 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/CloneableTest.java 2009-03-27 13:52:36 UTC (rev 1066)
@@ -35,6 +35,7 @@
public void testCloneable()
throws Exception
{
+ assertTrue( false );
/* // @todo re-enable
CloneableEJB obj = EquandaGlobal.getCloneable();
obj.init();
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/LinkTest.java 2009-03-27 13:52:36 UTC (rev 1066)
@@ -39,6 +39,7 @@
public void testNNLink()
throws Exception
{
+ assertTrue( false ); // @todo test is dysfunctional
int version = (int) System.currentTimeMillis();
Owner nick = Owner.equandaCreate();
nick.setName( "nick" + version );
@@ -122,6 +123,7 @@
public void test1NLink()
throws Exception
{
+ assertTrue( false ); // @todo test is dysfunctional
Owner george = Owner.equandaCreate();
george.equandaUpdate();
Owner mike = Owner.equandaCreate();
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/MultipleFieldTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/MultipleFieldTest.java 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/MultipleFieldTest.java 2009-03-27 13:52:36 UTC (rev 1066)
@@ -120,6 +120,7 @@
boolean skipTests, boolean multipleSets )
throws Exception
{
+ assertTrue( false ); // @todo test is dysfunctional
obj.equandaUpdate();
// check multiple string
@@ -193,6 +194,7 @@
private CocoonMan modifyMultipleFieldCheck( CocoonMan obj, Collection<Car> carsToset )
throws Exception
{
+ assertTrue( false ); // @todo test is dysfunctional
obj.equandaUpdate();
obj = setMultipleFieldCheck( obj, carsToset, true );
@@ -282,6 +284,8 @@
private CocoonMan modifyMultipleFieldCheck2( CocoonMan obj, Collection<Car> carsToset )
throws Exception
{
+ assertTrue( false ); // @todo test is dysfunctional
+
CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
obj.equandaUpdate();
obj = setMultipleFieldCheck( obj, carsToset, true );
@@ -388,6 +392,8 @@
private CocoonMan addNullToMultipleFieldCheck( CocoonMan obj, Collection<Car> carsToset, boolean shouldFail )
throws Exception
{
+ assertTrue( false ); // @todo test is dysfunctional
+
CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
obj.equandaUpdate();
obj = setMultipleFieldCheck( obj, carsToset, true );
@@ -470,6 +476,8 @@
private CocoonMan clearMultipleFieldWithNewCollCheck( CocoonMan obj, Collection<Car> carsToset )
throws Exception
{
+ assertTrue( false ); // @todo test is dysfunctional
+
CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
obj.equandaUpdate();
obj = setMultipleFieldCheck( obj, carsToset, true );
@@ -509,6 +517,8 @@
private CocoonMan clearMultipleFieldWithNullCheck( CocoonMan obj, Collection<Car> carsToset )
throws Exception
{
+ assertTrue( false ); // @todo test is dysfunctional
+
CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
obj.equandaUpdate();
obj = setMultipleFieldCheck( obj, carsToset, true );
@@ -552,6 +562,8 @@
Collection<Car> carsToset )
throws Exception
{
+ assertTrue( false ); // @todo test is dysfunctional
+
CocoonManSelectorEJB sel = EquandaGlobal.getCocoonManSelector();
obj.equandaUpdate();
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/ProxyTest.java 2009-03-27 13:52:36 UTC (rev 1066)
@@ -51,7 +51,6 @@
// to add tests for: link set, multiple field, multiple link, update on calculated
- /* // @todo re-enable
public void testActionProxy()
throws Exception
{
@@ -60,9 +59,7 @@
int res = action.hashCode( "hello !!!" );
assertEquals( "hello !!!".hashCode(), res );
}
- */
- /* // @todo re-enable
public void testActionNoUpdate()
throws Exception
{
@@ -75,9 +72,7 @@
action.equandaUpdate();
assertEquals( 3, action.getTheInt() );
}
- */
- /* // @todo re-enable
public void testActionUpdate()
throws Exception
{
@@ -89,7 +84,6 @@
action.addAction( 1 );
assertEquals( 3, action.getTheInt() );
}
- */
public void testAutoFields()
throws Exception
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SecurityTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SecurityTest.java 2009-03-27 11:21:13 UTC (rev 1065)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SecurityTest.java 2009-03-27 13:52:36 UTC (rev 1066)
@@ -24,8 +24,9 @@
package org.equanda.test.xejb;
-import org.equanda.test.dm.client.*;
-import org.equanda.test.dm.client.constants.*;
+import org.equanda.test.dm.client.EquandaGlobal;
+import org.equanda.test.dm.client.Secur;
+import org.equanda.test.dm.client.SecurSelectorEJB;
/**
* JUnit test for security roles
@@ -35,27 +36,12 @@
public class SecurityTest
extends TestAdapter
{
- /* // todo re-enable
- public void testAllowSetField()
- throws Exception
- {
- SecurEJB obj = EquandaGlobal.getSecur();
- obj.init( 1 );
- try
- {
- obj.setTestIntLocalUser( 1 );
- }
- catch ( RuntimeException e )
- {
- fail( "setTestIntLocalUser should be accessible to LocalUser" );
- }
- }
-
public void testAllowAction()
throws Exception
{
- SecurEJB obj = EquandaGlobal.getSecur();
- obj.init( 1 );
+ Secur obj = Secur.equandaCreate();
+ obj.setTestIntImmutableLocalUser( 1 );
+ obj.equandaUpdate();
try
{
obj.testProc2( "" );
@@ -69,8 +55,9 @@
public void testNotAllowAction()
throws Exception
{
- SecurEJB obj = EquandaGlobal.getSecur();
- obj.init( 1 );
+ Secur obj = Secur.equandaCreate();
+ obj.setTestIntImmutableLocalUser( 1 );
+ obj.equandaUpdate();
try
{
obj.testProc1( "" );
@@ -83,8 +70,9 @@
public void testNotAllowRemove()
throws Exception
{
- SecurEJB obj = EquandaGlobal.getSecur();
- obj.init( 1 );
+ Secur obj = Secur.equandaCreate();
+ obj.setTestIntImmutableLocalUser( 1 );
+ obj.equandaUpdate();
try
{
obj.removeEntityBean();
@@ -93,7 +81,6 @@
catch ( RuntimeException e )
{}
}
- */
public void testNotAllowSelect()
throws Exception
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-27 11:21:19
|
Revision: 1065
http://equanda.svn.sourceforge.net/equanda/?rev=1065&view=rev
Author: triathlon98
Date: 2009-03-27 11:21:13 +0000 (Fri, 27 Mar 2009)
Log Message:
-----------
translate title on select/edit pages
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm 2009-03-26 21:51:20 UTC (rev 1064)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm 2009-03-27 11:21:13 UTC (rev 1065)
@@ -39,7 +39,9 @@
import ${package}.base.EditPageBase;
import org.equanda.client.EquandaException;
import org.equanda.persistence.Uoid;
+import org.equanda.t5gui.services.EquandaMessages;
import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.ioc.annotations.Inject;
/**
* Default object edit page
@@ -48,9 +50,12 @@
public class ${table.Name}Edit
extends EditPageBase<${ejbPackage}.client.${table.Name}>
{
+ @Inject
+ private EquandaMessages messages;
+
public String getNavigationPageTitle()
{
- return "${table.Name}, Edit";
+ return messages.get( "table.${table.Name}" ) + ", " + messages.get( "Edit" );
}
public ${ejbPackage}.client.${table.Name} createObject()
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm 2009-03-26 21:51:20 UTC (rev 1064)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm 2009-03-27 11:21:13 UTC (rev 1065)
@@ -48,6 +48,7 @@
import org.apache.tapestry5.ComponentResources;
import org.equanda.client.EquandaException;
import org.equanda.persistence.SelectorsState;
+import org.equanda.t5gui.services.EquandaMessages;
import org.equanda.t5gui.ListGetter;
import org.equanda.t5gui.SelectedSetter;
@@ -63,9 +64,12 @@
{
private static final Logger equandaLog = Logger.getLogger( ${table.Name}${select.Name}.class );
+ @Inject
+ private EquandaMessages messages;
+
public String getNavigationPageTitle()
{
- return "${table.Name}, select";
+ return messages.get( "table.${table.Name}" ) + ", " + messages.get( "Select" );
}
@Inject
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-26 21:52:57
|
Revision: 1064
http://equanda.svn.sourceforge.net/equanda/?rev=1064&view=rev
Author: triathlon98
Date: 2009-03-26 21:51:20 +0000 (Thu, 26 Mar 2009)
Log Message:
-----------
base support for actions
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectBase.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini
Added Paths:
-----------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectRoot.java.vm
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectBase.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectBase.java.vm 2009-03-26 17:13:35 UTC (rev 1063)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectBase.java.vm 2009-03-26 21:51:20 UTC (rev 1064)
@@ -55,6 +55,8 @@
public class HT${table.Name}Base
#if( $table.isInherited() )
extends HT${table.ParentTable.Name}
+#else
+ extends HT${table.Name}Root
#end
{
}
Added: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectRoot.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectRoot.java.vm (rev 0)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HTObjectRoot.java.vm 2009-03-26 21:51:20 UTC (rev 1064)
@@ -0,0 +1,60 @@
+#* @vtlvariable name="table" type="org.equanda.domain.xml.transform.RootTable" *#
+#* @vtlvariable name="engine" type="org.equanda.generate.Generator" *#
+#* @vtlvariable name="package" type="java.lang.String" *#
+#* @vtlvariable name="generationdate" type="java.lang.String" *#
+#**
+ * 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/
+ *
+ * Code generated by applying this template can be freely used.
+ *
+ * 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.
+ *
+ * Contributor(s):
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ *#/**
+ * This file is generated by equanda on $generationdate, do not modify
+ */
+
+package ${package}.server;
+
+import ${package}.server.pm.DM${table.Name};
+import org.equanda.client.ExceptionCodes;
+import org.equanda.persistence.EquandaOperationNotAllowed;
+
+/**
+ * Root helper class for $table.Name
+ * $table.Description
+ */
+public class HT${table.Name}Root
+{
+#foreach( $action in $table.Actions )
+ public $action.Return ${action.Name}( DM${table.Name} entity
+#if( $action.Parameters.size() > 0 )
+ , $action.ParametersListWithTypes
+#end
+ )
+ throws EquandaException
+ {
+ throw new EquandaOperationNotAllowed( ExceptionCodes.UONA_OPERATION_NOT_ALLOWED,
+ "$table.Name, ${action.Name}, "+ entity.getEquandaType() );
+ }
+#end
+}
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-26 17:13:35 UTC (rev 1063)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-26 21:51:20 UTC (rev 1064)
@@ -433,33 +433,26 @@
/*
* $action.Description
*/
-/*
#actionSecurityRole( $action )
public $action.Return ${action.Name}( Uoid id
#if( $action.Parameters.size()>0 )
,$action.ParametersListWithTypes
#end
) throws EquandaException {
- ${table.Name}EJBLocal obj = null;
- try {
- #if( $action.Return!="void" )$action.Return ret;#end
- obj = EquandaGlobal.get${table.Name}Local();
- obj.init( id );
- #if( $action.Return!="void" )return #end obj.${action.Name}(
- $action.ParametersList
- );
- } finally {
- if ( obj != null ) obj.remove();
- }
+ DM${table.Name} entity = HR${table.Name}.selectId( entityManager, id );
+ HT${table.Name}Root helper = getTableHelper( entity );
+ #if( $action.Return!="void" )return #end helper.${action.Name}( entity
+#if( $action.Parameters.size() > 0 )
+ , $action.ParametersList
+#end
+ );
}
-*/
#foreach( $select in $table.SingleSelects )
/*
* $select.Name: $select.Description.
* $action.Name: $action.Description
*/
-/*
#selectSecurityRole( $select )
public $action.Return $engine.lowerFirst("${select.Name}")$engine.upperFirst("${action.Name}")
( $select.ParametersListWithTypesSingleSelect
@@ -469,17 +462,13 @@
#end
) throws EquandaException {
${table.Name}EJB obj = null;
- try {
- obj = select${select.Name}EJB( $select.ParametersListSingleSelect );
- if ( obj == null ) throw new EquandaException( EE_OBJECT_NOT_FOUND );
- #if( $action.Return!="void" )return #end obj.${action.Name}(
- $action.ParametersList
- );
- } finally {
- if ( obj != null ) obj.remove();
- }
+ DM${table.Name} entity = HR${table.Name}.select${select.Name}( entityManager, $select.ParametersListSingleSelect );
+ #if( $action.Return!="void" )return #end helper.${action.Name}( entity
+#if( $action.Parameters.size() > 0 )
+ , $action.ParametersList
+#end
+ );
}
-*/
#end
#end
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm 2009-03-26 17:13:35 UTC (rev 1063)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm 2009-03-26 21:51:20 UTC (rev 1064)
@@ -87,7 +87,6 @@
// actions
#foreach( $action in $table.Actions )
- /*
$action.Return ${action.Name}( Uoid uoid
#if( $action.Parameters.size()>0 )
,$action.ParametersListWithTypes
@@ -106,7 +105,6 @@
) throws EquandaException;
#end
- */
#end
#if ($table.hasSecurityRoleRemove())
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini 2009-03-26 17:13:35 UTC (rev 1063)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini 2009-03-26 21:51:20 UTC (rev 1064)
@@ -31,7 +31,10 @@
output6=${outputDir}${packageDir}client/HR${table}.java
template6=HRObject.java.vm
+output7=${outputDir}${packageDir}server/Ht${table}Root.java
+template7=HTObjectRoot.java.vm
+
[table]
// build entity bean
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-26 17:13:49
|
Revision: 1063
http://equanda.svn.sourceforge.net/equanda/?rev=1063&view=rev
Author: triathlon98
Date: 2009-03-26 17:13:35 +0000 (Thu, 26 Mar 2009)
Log Message:
-----------
fix remove on multiple fields (down to 56/21, 77 tests to go)
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-03-26 13:58:11 UTC (rev 1062)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-03-26 17:13:35 UTC (rev 1063)
@@ -50,6 +50,7 @@
{
Collection<$fieldtype2> fvl = spec.get${field.Name}();
for ( $fieldtype2 rem : fvl ) em.remove( rem );
+ fvl.clear();
}
else
{
@@ -127,9 +128,20 @@
for ( $fieldtype ro : rem )
{
#if( $field.isLink() )
- if ( ro != null && ro.getId() != null ) em.remove( em.find( DM${field.LinkTableName}.class, ro.getId() ) );
+ if ( ro != null && ro.getId() != null )
+ {
+ em.remove( em.find( DM${field.LinkTableName}.class, ro.getId() ) );
+ }
#else
- em.remove( ro );
+ for ( $fieldtype2 test : spec.get${field.Name}() )
+ {
+ if ( ro.equals( test.get${field.Name}() ) )
+ {
+ spec.get${field.Name}().remove( test );
+ em.remove( test );
+ break;
+ }
+ }
#end
}
fval.reset();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-26 13:58:54
|
Revision: 1062
http://equanda.svn.sourceforge.net/equanda/?rev=1062&view=rev
Author: triathlon98
Date: 2009-03-26 13:58:11 +0000 (Thu, 26 Mar 2009)
Log Message:
-----------
multiple fields partially working (down to 55/34, 89 tests to go)
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/EquandaQueryTest.java
branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SelectorsSortingTest.java
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm 2009-03-25 21:51:07 UTC (rev 1061)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObject.java.vm 2009-03-26 13:58:11 UTC (rev 1062)
@@ -50,6 +50,7 @@
import javax.persistence.*;
import java.sql.Timestamp;
+import java.util.ArrayList;
import java.util.Collection;
import org.equanda.util.Base64;
@@ -105,8 +106,12 @@
#if ( $field.isLink() )#set( $fieldtype="DM${field.LinkTable.Name}" )
#elseif ( $field.isMultiple() ) #set( $fieldtype="${package}.server.pm.DM${table.Name}_${field.Name}" )
#end
- #if( $field.isMultiple() )#set( $fieldtype="Collection<$fieldtype>" )#end
+ #if( $field.isMultiple() )
+ private Collection<$fieldtype> $field.VarName = new ArrayList<$fieldtype>();
+ #set( $fieldtype="Collection<$fieldtype>" )
+ #else
private $fieldtype $field.VarName;
+ #end
#end##foreach field
#foreach( $ck in $table.CascadeKeepNotBidirectional )
private Collection<DM${ck.TableName}> equanda${ck.TableName}${ck.FieldName} = new java.util.ArrayList<DM${ck.TableName}>();
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2009-03-25 21:51:07 UTC (rev 1061)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/EquandaGlobal.java.vm 2009-03-26 13:58:11 UTC (rev 1062)
@@ -123,12 +123,14 @@
#foreach( $field in $table.LinkFields )
#if( $field.hasCompare() )
+#* @todo need to fix
#set( $sep = "" )
#set( $test = "" )
#foreach( $ii in $field.Compares )
#set( $test = "$sep o.equandaType = '${ii.TypeValue}'" )
#set( $sep = "" )
#end
+*#
queryStrings.put( "${table.Name}.equandaCompareType${field.Name}", "$test" );
#end
#end
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2009-03-25 21:51:07 UTC (rev 1061)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2009-03-26 13:58:11 UTC (rev 1062)
@@ -332,12 +332,12 @@
throw new EquandaException( e );
}
#if( !$field.isMultiple() )
- //proxy.${field.VarName} = obj.getEquanda${field.Name}( proxy.id ); @todo FIX !!
+ proxy.${field.VarName} = obj.getEquanda${field.Name}( proxy.id );
#else
#set( $EquandaListItemType=$field.JavaFieldType )
#if( $field.isLink() ) #set( $EquandaListItemType="${field.JavaFieldType}" ) #end
proxy.${field.VarName} = new EquandaList<${EquandaListItemType}>();
- //proxy.${field.VarName}.addAll( obj.getEquanda${field.Name}( proxy.id ) ); @todo FIX !!
+ proxy.${field.VarName}.addAll( obj.getEquanda${field.Name}( proxy.id ) );
( ( EquandaList ) proxy.${field.VarName} ).reset();
#end
_obtained${field.Name} = true;
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-25 21:51:07 UTC (rev 1061)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-26 13:58:11 UTC (rev 1062)
@@ -401,7 +401,7 @@
//obj.init( proxy.getEquandaType() #foreach( $field in $table.ImmutableFields ), proxy.get${field.Name}() #set( $sep="," )#end );
else
entity = HR${table.Name}.selectId( entityManager, id );
- HR${table.Name}.update${table.Name}( entity, proxy );
+ HR${table.Name}.update( entityManager, entity, proxy );
if ( null == id ) entityManager.persist( entity );
entityManager.flush(); // force save to have correct equandaModification and equandaStatus fields
//if ( objProxy == null )
@@ -492,8 +492,121 @@
try
{
DM${table.Name} entity = HR${table.Name}.selectId( entityManager, id );
- entityManager.remove( entity );
+ if ( null != entity )
+ {
+#foreach( $ck in $table.CascadeKeep )
+// CascadeKeep bidi $ck.isBidirectional() fieldname $ck.FieldName linkedfieldname $ck.LinkedFieldName table $ck.LinkedTableName varname $ck.VarName owner $ck.isOwner
+#if ( $ck.isBidirectional() )
+#if( $ck.isMultiple() )
+ if ( !entity.get${ck.linkedFieldName}().isEmpty() )
+#else
+ if ( null != entity.get${ck.linkedFieldName}() )
+#end
+#else
+ //if ( !entity.getEquanda${ck.TableName}${ck.FieldName}().isEmpty() )
+ if ( false )
+#end
+ {
+ #if( $ck.isBidirectional() )
+ #if( $ck.isCascade() )
+ throw new EquandaConstraintViolation(ECV_CASCADE_KEEP, "${ck.TableName}.${ck.FieldName}");
+ #else
+ #if( $ck.isOwner() )
+ #if( !$ck.isMultiple() )
+ entity.get${ck.linkedFieldName}().set${ck.FieldName}(null);
+ #else
+ Collection<DM${ck.tableName}> col = entity.get${ck.linkedFieldName}();
+ for ( DM${ck.tableName} obj : col ) obj.set${ck.FieldName}(null);
+ #end
+ #else
+ #if( $ck.isMultiple() )
+ Collection<DM${ck.TableName}> others = entity.get${ck.linkedFieldName}();
+ for ( DM${ck.TableName} other : others )
+ {
+ #set( $fldName=$ck.FieldName )
+ #if( $ck.isFieldMultiple() )
+ Collection<DM${table.Name}> col = other.get${fldName}();
+ for ( DM${table.Name} obj : col )
+ {
+ if ( obj.getId().equals( entity.getId() ) )
+ {
+ col.remove(obj);
+ break;
+ }
+ }
+ #else
+ other.set${fldName}( null );
+ #end
+ }
+ #else
+ DM${ck.TableName} other = entity.get${ck.linkedFieldName}();
+ other.set${ck.FieldName}( null );
+ #end
+ #end
+ #end ## is Cascade
+ #else ## not Bidirectional
+ #if( $ck.isCascade() )
+ throw new EquandaConstraintViolation(ECV_CASCADE_KEEP, "${ck.TableName}.${ck.FieldName}");
+ #else
+ /*
+ #if( $ck.isOwner() )
+ #if( !$ck.isMultiple() )
+ entity.setEquanda${ck.TableName}${ck.FieldName}(null);
+ #else
+ entity.setEquanda${ck.TableName}${ck.FieldName}.clear();
+ #end
+ #else
+ Collection<DM${ck.TableName}> other = entity.getEquanda${ck.TableName}${ck.FieldName}();
+ for ( DM${ck.TableName} bean : other )
+ {
+ #set( $fldName=$ck.FieldName )
+ #if( $ck.isFieldMultiple() )
+ Collection<DM${table.Name}> col = bean.get${fldName}();
+ for ( DM${table.Name} obj : col )
+ {
+ if ( obj.getId().equals(entity.getId()) )
+ {
+ col.remove(obj);
+ break;
+ }
+ }
+ #else
+ bean.set${fldName}( null );
+ #end
+ }
+ #end
+ */
+ #end ## is Cascade
+ #end
+ }
+
+#end
+#foreach( $field in $table.EmbeddedLinkFields )
+ #if( !$field.isMultiple() )
+ if ( entity.get${field.Name}() != null )
+ {
+ ${field.LinkTable.Name}SelectorEJB remEjb = EquandaGlobal.get${field.LinkTable.Name}Selector();
+ remEjb.removeEntityBean( entity.get${field.Name}().getId() );
+ remEjb.remove();
+ }
+ #else
+ if ( !entity.get${field.Name}().isEmpty() )
+ {
+ Collection<DM${field.LinkTable.Name}> col = entity.get${field.Name}();
+ Collection<Uoid> colTmp = new ArrayList<Uoid>();
+ for ( DM${field.LinkTable.Name} colit : col ) colTmp.add( colit.getId() );
+ ${field.LinkTable.Name}SelectorEJB remEjb = EquandaGlobal.get${field.LinkTable.Name}Selector();
+ for ( Uoid colit : colTmp )
+ {
+ remEjb.removeEntityBean( colit );
}
+ remEjb.remove();
+ }
+ #end
+#end
+ entityManager.remove( entity );
+ }
+ }
catch ( Exception e )
{
throw new EquandaException( EE_OBJECT_NOT_FOUND, e );
@@ -518,7 +631,6 @@
/*
* $field.Description
*/
- /*
public $fieldtype getEquanda${field.Name}( Uoid id )
throws EquandaException
{
@@ -528,28 +640,27 @@
#if( !$field.isMultiple() )
res = null;
- ${field.JavaFieldType}EJB other = bean.get${field.Name}();
+ DM${field.LinkTableName} other = entity.get${field.Name}();
if ( other != null )
{
- res = other.getEquanda();
- other.remove();
+ res = HR${field.LinkTableName}.get( other );
}
#else ## isMultiple
+ res = new ArrayList<${field.JavaFieldType}>();
#if( !$field.isLink() )
- res = bean.get${field.Name}();
+ for( DM${table.Name}_${field.Name} one : entity.get${field.Name}() )
+ {
+ res.add( one.get${field.Name}() );
+ }
#else
- res = new ArrayList<${field.JavaFieldType}>();
- for ( ${field.JavaFieldType}EJB al : bean.get${field.Name}() )
+ for ( DM${field.LinkTableName} one : entity.get${field.Name}() )
{
- res.add( al.getEquanda() );
- al.remove();
+ res.add( HR${field.LinkTableName}.get( one ) );
}
#end
#end
- bean.remove();
return res;
}
- */
#end
private ${package}.client.${table.Name} get( DM${table.Name} entity )
@@ -560,7 +671,7 @@
return null;
}
- return HR${table.Name}.get${table.Name}( entity );
+ return HR${table.Name}.get( entity );
}
private ${package}.client.${table.Name} get( EquandaQuery query )
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm 2009-03-25 21:51:07 UTC (rev 1061)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorEJB.java.vm 2009-03-26 13:58:11 UTC (rev 1062)
@@ -127,7 +127,7 @@
/**
* $field.Description
*/
- //$fieldtype getEquanda${field.Name}( Uoid uoid )
- // throws EquandaException;
+ $fieldtype getEquanda${field.Name}( Uoid uoid )
+ throws EquandaException;
#end
}
\ No newline at end of file
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-03-25 21:51:07 UTC (rev 1061)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-03-26 13:58:11 UTC (rev 1062)
@@ -3,7 +3,7 @@
#* @vtlvariable name="engine" type="org.equanda.generate.Generator" *#
#* @vtlvariable name="package" type="java.lang.String" *#
#* @vtlvariable name="generationdate" type="java.lang.String" *#
- public static void update${table.Name}( DM${table.Name} entity, ${table.Name} obj )
+ public static void update( EntityManager em, DM${table.Name} entity, ${table.Name} obj )
throws EquandaException
{
if ( obj != null && obj.getId() != null )
@@ -37,50 +37,65 @@
#end
DM${field.DmTable.Name} spec = (DM${field.DmTable.Name})entity;
#set( $fieldtype = $field.JavaFieldType )
- #set( $lnk = "" )
#set( $hasFields = true )
#if( $field.isLink() )
- #set( $lnk="EquandaLink" )
#set( $fieldtype="${field.LinkTable.Name}" )
#end
- #set( $fieldtype2 = $fieldtype )
- #if( $field.isLink() )#set( $fieldtype2 = "Uoid" )#end
+ #set( $fieldtype2 = "DM${table.Name}_${field.Name}" )
+ #if( $field.isLink() )#set( $fieldtype2 = "DM${field.LinkTableName}" )#end
#if( $field.isMultiple() )
- /*
errorField = "$field.Name";
Collection<$fieldtype> al = proxy.${field.VarName};
if ( al == null || al.isEmpty() )
{
- EquandaList<$fieldtype2> fvl = (EquandaList<$fieldtype2>)( spec.get$lnk${field.Name}() );
- //for ( $fieldtype2 rem : fvl ) spec.remove$lnk${field.Singular}( rem );//@todo
+ Collection<$fieldtype2> fvl = spec.get${field.Name}();
+ for ( $fieldtype2 rem : fvl ) em.remove( rem );
}
else
{
- EquandaList<$fieldtype2> last = (EquandaList<$fieldtype2>)( spec.get$lnk${field.Name}() );
+ Collection<$fieldtype2> last = spec.get${field.Name}();
for ( $fieldtype ito : al )
{
if ( ito != null )
{
#if( !$field.isLink() )
- if ( !last.contains( ito ) ) spec.add$lnk${field.Singular}( ito );
+ boolean contains = false;
+ for ( $fieldtype2 test : last )
+ {
+ contains |= ito.equals( test.get${field.Name}() );
+ }
+ if ( !contains )
+ {
+ spec.get${field.Name}().add( new $fieldtype2( ito ) );
+ }
#else
if ( !ito.getEquandaProxy().updateInProgress && ( ito.getId() == null || ito.isModified() ) )
{
- #if ($field.isBidirectional())
- // before updating the bidir proxy set the bidir link in case this is required
- #if ($field.linkField.isMultiple())
- ito.get${field.linkField.Name}().add( spec );
- #else
- ito.set${field.linkField.Name}( spec );
- #end
- #end
ito.equandaUpdate();
}
- if ( !last.contains( ito.getEquandaProxy().id ) ) spec.add$lnk${field.Singular}( ito.getEquandaProxy().id );
+ #if ($field.isBidirectional())
+ DM${field.LinkTableName} link = em.find( DM${field.LinkTableName}.class, ito.getId() );
+ // before updating the bidir proxy set the bidir link in case this is required
+ #if ($field.linkField.isMultiple())
+ link.get${field.linkField.Name}().add( spec );
+ #else
+ link.set${field.linkField.Name}( spec );
+ #end
+ #end
+ boolean contains = false;
+ for ( $fieldtype2 test : last )
+ {
+ contains |= ito.getId().equals( test.getId() );
+ }
+ if ( !contains )
+ {
+ spec.get${field.Name}().add( em.find( DM${field.LinkTableName}.class,ito.getId() ) );
+ }
+
#end
}
}
- EquandaList<$fieldtype2> fvl = (EquandaList<$fieldtype2>)(spec.get$lnk${field.Name}());
+ Collection<$fieldtype2> fvl = spec.get${field.Name}();
if ( !( al instanceof EquandaList ) )
{
if ( al.size() != fvl.size() ) {
@@ -90,15 +105,15 @@
boolean found = false;
for ( $fieldtype uv : al )
{
- if ( inst.equals( uv.getEquandaProxy().id ) )
+ if ( inst.equals( uv.getId() ) )
{
found = true;
break;
}
}
- //if ( !found ) spec.remove$lnk${field.Singular}( inst );//@todo
+ if ( !found ) em.remove( inst );
#else
- //if ( !al.contains( inst ) ) spec.remove$lnk${field.Singular}( inst );//@todo
+ if ( !al.contains( inst ) ) em.remove( inst );
#end
}
}
@@ -112,23 +127,22 @@
for ( $fieldtype ro : rem )
{
#if( $field.isLink() )
- if ( ro != null && ro.getEquandaProxy().id != null ) spec.remove$lnk${field.Singular}( ro.getEquandaProxy().id );
+ if ( ro != null && ro.getId() != null ) em.remove( em.find( DM${field.LinkTableName}.class, ro.getId() ) );
#else
- //spec.remove$lnk${field.Singular}( ro );//@todo
+ em.remove( ro );
#end
}
fval.reset();
}
}
}
- */
#else ## if (isMultiple...)
errorField="$field.Name";
#if( !$field.isLink() )
#if( $field.isInt() || $field.isDouble() || $field.isBoolean() )
if ( proxy.${field.VarName} != spec.get${field.Name}() )
{
- spec.set$lnk${field.Name}(proxy.${field.VarName});
+ spec.set${field.Name}(proxy.${field.VarName});
}
#else
if ( !StringUtil.objectEquals(proxy.${field.VarName}, spec.get${field.Name}()) )
@@ -137,7 +151,6 @@
}
#end
#else ## isLink single
- /*
if ( proxy.${field.VarName} == null )
{
spec.set${field.Name}( null );
@@ -147,27 +160,26 @@
$fieldtype linkField = proxy.${field.VarName};
if ( !linkField.getEquandaProxy().updateInProgress && ( linkField.getId() == null || linkField.isModified() ) )
{
- #if ($field.isBidirectional())
- // before updating the bidir proxy set the bidir link in case this is required
- #if ($field.linkField.isMultiple())
- linkField.get${field.linkField.Name}().add( spec );
- #else
- linkField.set${field.linkField.Name}( spec );
- #end
- #end
linkField.equandaUpdate();
}
+ #if ($field.isBidirectional())
+ DM${field.LinkTableName} link = em.find( DM${field.LinkTableName}.class, linkField.getId() );
+ // before updating the bidir proxy set the bidir link in case this is required
+ #if ($field.linkField.isMultiple())
+ link.get${field.linkField.Name}().add( spec );
+ #else
+ link.set${field.linkField.Name}( spec );
+ #end
+ #end
${field.JavaEntityType} current = spec.get${field.Name}();
- if ( current == null || !current.getId().equals( linkField.getEquandaProxy().id ) )
+ if ( current == null || !current.getId().equals( linkField.getId() ) )
{
- if ( linkField.getEquandaProxy().id != null ){
- //${field.JavaEntityType} other = EquandaGlobal.get${field.FieldTypeName}();//@todo
- //other.init( linkField.getEquandaProxy().id );//@todo
- spec.set${field.Name}( other );
+ if ( linkField.getId() != null )
+ {
+ spec.set${field.Name}( em.find( DM${field.LinkTableName}.class, linkField.getId() ) );
}
}
}
- */
#end
#end
}
@@ -204,7 +216,7 @@
#end
#end
- public static ${table.Name} get${table.Name}( DM${table.Name} entity )
+ public static ${table.Name} get( DM${table.Name} entity )
{
#foreach( $type in $table.TablesNotInternal )
if ( entity instanceof DM${type.Name} )
Modified: branches/EQ-130/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm 2009-03-25 21:51:07 UTC (rev 1061)
+++ branches/EQ-130/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm 2009-03-26 13:58:11 UTC (rev 1062)
@@ -100,7 +100,7 @@
roles.add( "${engine.getConfig("default-role")}" );
}
- LoginInfo info = new LoginInfo( HREquandaUser.getEquandaUser( dmUser ) );
+ LoginInfo info = new LoginInfo( HREquandaUser.get( dmUser ) );
info.setGuiAdministrator( isAdmin );
info.setGuiAccessProhibited( isNotGui );
info.setRoles( roles );
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/EquandaQueryTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/EquandaQueryTest.java 2009-03-25 21:51:07 UTC (rev 1061)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/EquandaQueryTest.java 2009-03-26 13:58:11 UTC (rev 1062)
@@ -89,7 +89,7 @@
// build selector
EquandaQuery query = new EquandaQueryImpl(
- "SELECT o FROM DMVehicleBean o WHERE ( o.colourCode = :colourCode ) ORDER BY o.name" );
+ "SELECT o FROM DMVehicle o WHERE ( o.colourCode = :colourCode ) ORDER BY o.name" );
query.setParameter( "colourCode", 55 );
// check type filter
assertEquals( 3, selector.selectEquanda( query ).size() );
@@ -178,8 +178,8 @@
// build selector
EquandaQueryImpl query = new EquandaQueryImpl(
- "SELECT o FROM DMVehicleBean o WHERE ( o.colourCode = :colourCode ) ORDER BY o.name",
- "SELECT COUNT(o) FROM DMVehicleBean o WHERE ( o.colourCode = :colourCode ) ORDER BY o.name" );
+ "SELECT o FROM DMVehicle o WHERE ( o.colourCode = :colourCode ) ORDER BY o.name",
+ "SELECT COUNT(o) FROM DMVehicle o WHERE ( o.colourCode = :colourCode ) ORDER BY o.name" );
query.setParameter( "colourCode", 56 );
// check collection size
@@ -205,7 +205,7 @@
// test without count query
query = new EquandaQueryImpl(
- "SELECT o FROM DMVehicleBean o WHERE ( o.colourCode = :colourCode AND o.name = :name ) ORDER BY o.name" );
+ "SELECT o FROM DMVehicle o WHERE ( o.colourCode = :colourCode AND o.name = :name ) ORDER BY o.name" );
query.setParameter( "colourCode", 56 );
query.setParameter( "name", "3Correct Airplane" );
coll = selector.selectEquanda( query );
@@ -264,7 +264,7 @@
val6.equandaUpdate();
// check lazy collection iteration without modification of results
- EquandaQueryImpl query = new EquandaQueryImpl( "SELECT o FROM DMVehicleBean o WHERE o.colourCode = 1" );
+ EquandaQueryImpl query = new EquandaQueryImpl( "SELECT o FROM DMVehicle o WHERE o.colourCode = 1" );
List<Vehicle> coll = selector.selectEquanda( query );
assertEquals( 6, coll.size() );
@@ -284,7 +284,7 @@
assertEquals( count, 5 );
}
- query = new EquandaQueryImpl( "SELECT o FROM DMVehicleBean o WHERE o.speed = 100" );
+ query = new EquandaQueryImpl( "SELECT o FROM DMVehicle o WHERE o.speed = 100" );
try
{
coll = selector.selectEquanda( query );
@@ -322,7 +322,7 @@
car2.equandaUpdate();
// delete old records (shoulld keep car2
- EquandaQueryImpl query = new EquandaQueryImpl( "delete from DMCarBean o where o.brand <= :brand" );
+ EquandaQueryImpl query = new EquandaQueryImpl( "delete from DMCar o where o.brand <= :brand" );
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put( "brand", car1.getBrand() );
query.setParameters( parameters );
@@ -364,7 +364,7 @@
// delete old records (shoulld keep car2
EquandaQueryImpl query =
- new EquandaQueryImpl( "delete from DMCarBean o where o.equandaModificationDate <= :time" );
+ new EquandaQueryImpl( "delete from DMCar o where o.equandaModificationDate <= :time" );
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put( "time", threshold );
query.setParameters( parameters );
Modified: branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SelectorsSortingTest.java
===================================================================
--- branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SelectorsSortingTest.java 2009-03-25 21:51:07 UTC (rev 1061)
+++ branches/EQ-130/equanda-test/test-test/src/test/java/org/equanda/test/xejb/SelectorsSortingTest.java 2009-03-26 13:58:11 UTC (rev 1062)
@@ -74,7 +74,7 @@
// Do the same as above but for for a custom query
SelectorsState.setSorting( "CocoonMan", "firstName" );
- EquandaQuery customQuery = new EquandaQueryImpl( "SELECT o FROM DMCocoonManBean o ORDER BY o.firstName" );
+ EquandaQuery customQuery = new EquandaQueryImpl( "SELECT o FROM DMCocoonMan o ORDER BY o.firstName" );
results = sel.equandaRunQuery( customQuery );
assertEquals( "A", results.get( 0 ).getFirstName() );
assertEquals( "B", results.get( 1 ).getFirstName() );
@@ -83,7 +83,7 @@
// Do the same as above but for for a custom query
SelectorsState.setSorting( "CocoonMan", "-firstName" );
- customQuery = new EquandaQueryImpl( "SELECT o FROM DMCocoonManBean o ORDER BY o.firstName" );
+ customQuery = new EquandaQueryImpl( "SELECT o FROM DMCocoonMan o ORDER BY o.firstName" );
results = sel.equandaRunQuery( customQuery );
assertEquals( "D", results.get( 0 ).getFirstName() );
assertEquals( "C", results.get( 1 ).getFirstName() );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-25 21:51:17
|
Revision: 1061
http://equanda.svn.sourceforge.net/equanda/?rev=1061&view=rev
Author: triathlon98
Date: 2009-03-25 21:51:07 +0000 (Wed, 25 Mar 2009)
Log Message:
-----------
integrate DMObjectSelector in HRObject
Modified Paths:
--------------
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HRObject.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini
branches/EQ-130/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm
branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/LinkableMediator.java
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2009-03-25 13:44:28 UTC (rev 1060)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/DMObjectSelector.java.vm 2009-03-25 21:51:07 UTC (rev 1061)
@@ -29,32 +29,7 @@
*
* Contributor(s):
* @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- *#/**
- * This file is generated by equanda on $generationdate, do not modify
- */
-
-package ${package}.server.pm;
-
-import ${package}.client.*;
-import org.equanda.persistence.ObjectType;
-import org.equanda.persistence.query.EquandaQuery;
-import org.equanda.persistence.query.EquandaQueryImpl;
-import org.equanda.persistence.Uoid;
-import org.equanda.persistence.ObjectSelector;
-import org.equanda.persistence.SelectorsState;
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Utility class which combined the selectors for $table.Name
- * $table.Description
- */
-public class DM${table.Name}Selector
-{
-
+ *#
#macro( selectQueryParameters $select )
#foreach( $sel in $select.SelectionsDeep )
#if( !$sel.VarName.equals("equandaLimit") && $sel.isParameter() && $sel.isTestComparison() )
@@ -255,7 +230,7 @@
}
#end
#foreach( $field in $table.UniqueForFields )
- public static long count${field.Name}( EntityManager em, ${field.JavaFieldType} ${field.VarName},
+ public static long count${field.Name}( EntityManager em, ${field.JavaFieldType} ${field.VarName},
${field.UniqueForField.JavaEntityType} equandaFor )
{
EquandaQuery query;
@@ -319,5 +294,3 @@
return query.getResultList();
} finally { equandaQuery.clearExtra(); }
}
-
-}
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HRObject.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HRObject.java.vm 2009-03-25 13:44:28 UTC (rev 1060)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/HRObject.java.vm 2009-03-25 21:51:07 UTC (rev 1061)
@@ -41,17 +41,26 @@
import org.equanda.client.EquandaException;
import org.equanda.persistence.Uoid;
import org.equanda.client.ExceptionCodes;
+import org.equanda.persistence.ConcurrentModificationException;
import org.equanda.persistence.EquandaList;
import org.equanda.persistence.EquandaConstraintViolation;
import org.equanda.persistence.EquandaPersistenceException;
+import org.equanda.persistence.ObjectSelector;
import org.equanda.persistence.ObjectType;
-import org.equanda.persistence.ConcurrentModificationException;
+import org.equanda.persistence.SelectorsState;
+import org.equanda.persistence.Uoid;
+import org.equanda.persistence.query.EquandaQuery;
+import org.equanda.persistence.query.EquandaQueryImpl;
import org.equanda.util.StringUtil;
import ${package}.server.pm.*;
-import java.util.List;
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
/**
* Helper class for RootTable $table.Name (part of client package for package local access, not needed for clients).
@@ -63,4 +72,5 @@
private static final Logger log = Logger.getLogger( HR${table.Name}.class );
#parse( "ProxyObjectUpdater.java.vm" )
+#parse( "DMObjectSelector.java.vm" )
}
\ No newline at end of file
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-25 13:44:28 UTC (rev 1060)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ObjectSelectorBean.java.vm 2009-03-25 21:51:07 UTC (rev 1061)
@@ -159,7 +159,7 @@
throws EquandaException
{
if ( id == null ) return null;
- DM${table.Name} entity = DM${table.Name}Selector.selectId( entityManager, id );
+ DM${table.Name} entity = HR${table.Name}.selectId( entityManager, id );
return get( entity );
}
@@ -187,7 +187,7 @@
public List<Uoid> equandaRunQueryId( EquandaQuery query )
throws EquandaException
{
- List<DM${table.Name}> col=DM${table.Name}Selector.equandaRunQuery( entityManager, query );
+ List<DM${table.Name}> col = HR${table.Name}.equandaRunQuery( entityManager, query );
List<Uoid> val = new ArrayList<Uoid>();
for ( DM${table.Name} obj : col )
{
@@ -199,7 +199,7 @@
public List<${package}.client.${table.Name}> equandaRunQuery( EquandaQuery query )
throws EquandaException
{
- List<DM${table.Name}> col = DM${table.Name}Selector.equandaRunQuery( entityManager, query );
+ List<DM${table.Name}> col = HR${table.Name}.equandaRunQuery( entityManager, query );
List<${package}.client.${table.Name}> val = new ArrayList<${package}.client.${table.Name}>();
for ( DM${table.Name} obj : col )
{
@@ -211,7 +211,7 @@
public long equandaRunCountQuery( EquandaQuery query )
throws EquandaException
{
- List res = DM${table.Name}Selector.runCountQuery( entityManager, query );
+ List res = HR${table.Name}.runCountQuery( entityManager, query );
long count = (Long)res.get(0);
int first = query.getFirstResult();
int max = query.getMaxResults();
@@ -276,7 +276,7 @@
#if( $select.ParametersList == "" )#set( $sep = "" )#end
#set( $tf = "null" )
#if( ${table.Name}!=${select.TableName} )#set( $tf = "new ${package}.client.type.${select.tableName}Type()" )#end
- return DM${table.Name}Selector.select${select.Name}( entityManager, $tf$sep$select.ParametersList );
+ return HR${table.Name}.select${select.Name}( entityManager, $tf$sep$select.ParametersList );
}
#set( $return="List<${package}.client.${table.Name}>" )
@@ -313,7 +313,7 @@
#if( $select.ParametersList == "" )#set( $sep = "" )#end
#set( $tf = "null" )
#if( ${table.Name}!=${select.TableName} )#set( $tf = "new ${package}.client.type.${select.tableName}Type()" )#end
- return DM${table.Name}Selector.get${select.Name}Query( $tf$sep$select.ParametersIdList );
+ return HR${table.Name}.get${select.Name}Query( $tf$sep$select.ParametersIdList );
}
#set( $return="List<${package}.client.${table.Name}>" )
@@ -378,7 +378,7 @@
*/
#buildSecurityRole( $build )
public ${package}.client.${table.Name} equandaClone( String type, Uoid base ) throws EquandaException {
- //DM${table.Name} base = DM${table.Name}Selector.selectId( entityManager, base );
+ //DM${table.Name} base = HR${table.Name}.selectId( entityManager, base );
DM${table.Name} entity = new DM${table.Name}();
//setAutoFields(entity);
//mediator.equandaClone( other );
@@ -400,7 +400,7 @@
entity = new DM${table.Name}();
//obj.init( proxy.getEquandaType() #foreach( $field in $table.ImmutableFields ), proxy.get${field.Name}() #set( $sep="," )#end );
else
- entity = DM${table.Name}Selector.selectId( entityManager, id );
+ entity = HR${table.Name}.selectId( entityManager, id );
HR${table.Name}.update${table.Name}( entity, proxy );
if ( null == id ) entityManager.persist( entity );
entityManager.flush(); // force save to have correct equandaModification and equandaStatus fields
@@ -417,7 +417,7 @@
@RolesAllowed({ "LocalUser" ,"LocalAdmin" })
public ${package}.client.${table.Name} equandaRefresh( Uoid id, long version ) throws EquandaException {
if ( id == null ) return null;
- DM${table.Name} entity = DM${table.Name}Selector.selectId( entityManager, id );
+ DM${table.Name} entity = HR${table.Name}.selectId( entityManager, id );
if ( entity == null )
{
throw new EquandaException( EE_FAILED_TO_UPDATE_VALUE, id.toString() );
@@ -491,7 +491,7 @@
{
try
{
- DM${table.Name} entity = DM${table.Name}Selector.selectId( entityManager, id );
+ DM${table.Name} entity = HR${table.Name}.selectId( entityManager, id );
entityManager.remove( entity );
}
catch ( Exception e )
@@ -524,7 +524,7 @@
{
if ( id == null ) return null;
$fieldtype res;
- DM${table.Name} entity = DM${table.Name}Selector.selectId( entityManager, id );
+ DM${table.Name} entity = HR${table.Name}.selectId( entityManager, id );
#if( !$field.isMultiple() )
res = null;
@@ -567,7 +567,7 @@
throws EquandaException
{
if ( query == null ) return null;
- List<DM${table.Name}> list = DM${table.Name}Selector.equandaRunQuery( entityManager, query );
+ List<DM${table.Name}> list = HR${table.Name}.equandaRunQuery( entityManager, query );
if ( list.size() == 0 ) return null;
return get( list.get( 0 ) );
}
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini 2009-03-25 13:44:28 UTC (rev 1060)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3.ini 2009-03-25 21:51:07 UTC (rev 1061)
@@ -28,13 +28,10 @@
output5=${outputDir}${packageDir}client/${table}SelectorEJB.java
template5=ObjectSelectorEJB.java.vm
-output6=${outputDir}${packageDir}server/pm/DM${table}Selector.java
-template6=DMObjectSelector.java.vm
+output6=${outputDir}${packageDir}client/HR${table}.java
+template6=HRObject.java.vm
-output7=${outputDir}${packageDir}client/HR${table}.java
-template7=HRObject.java.vm
-
[table]
// build entity bean
Modified: branches/EQ-130/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm 2009-03-25 13:44:28 UTC (rev 1060)
+++ branches/EQ-130/equanda-generate/src/main/velocity/login/bean/LoginBean.java.vm 2009-03-25 21:51:07 UTC (rev 1061)
@@ -35,9 +35,8 @@
import org.equanda.client.LoginInfo;
#set( $ejbPackage=${engine.getConfig("ejb-package")} )
import ${ejbPackage}.server.pm.DMEquandaUser;
-import ${ejbPackage}.server.pm.DMEquandaUserSelector;
import ${ejbPackage}.server.pm.DMEquandaRole;
-import ${ejbPackage}.server.pm.DMEquandaRoleSelector;
+import ${ejbPackage}.client.HREquandaRole;
import ${ejbPackage}.client.HREquandaUser;
import org.apache.log4j.Logger;
import org.equanda.client.EquandaException;
@@ -72,7 +71,7 @@
throws EquandaException
{
List<DMEquandaUser> users =
- DMEquandaUserSelector.equandaRunQuery( em, DMEquandaUserSelector.getUserNameQuery( null, username ) );
+ HREquandaUser.equandaRunQuery( em, HREquandaUser.getUserNameQuery( null, username ) );
if ( users.size() != 0 )
{
DMEquandaUser dmUser = users.get( 0 );
@@ -117,7 +116,7 @@
public String getRoleAuthAndConfig( String role )
{
List<DMEquandaRole> roles =
- DMEquandaRoleSelector.equandaRunQuery( em, DMEquandaRoleSelector.getRoleQuery( null, role ) );
+ HREquandaRole.equandaRunQuery( em, HREquandaRole.getRoleQuery( null, role ) );
if ( roles.size() != 0 )
{
DMEquandaRole dmRole = roles.get( 0 );
Modified: branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/LinkableMediator.java
===================================================================
--- branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/LinkableMediator.java 2009-03-25 13:44:28 UTC (rev 1060)
+++ branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/dm/server/LinkableMediator.java 2009-03-25 21:51:07 UTC (rev 1061)
@@ -29,7 +29,6 @@
import org.equanda.persistence.Uoid;
import static org.equanda.test.TestExceptionCodes.ECV_REMOVE2_NOT_ALOWED_STRING_TO_ADD;
//import org.equanda.test.dm.server.pm.DMRemove2Bean;
-import org.equanda.test.dm.server.pm.DMRemove2Selector;
/**
* Mediator for "Linkable"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2009-03-25 14:22:31
|
Revision: 1060
http://equanda.svn.sourceforge.net/equanda/?rev=1060&view=rev
Author: triathlon98
Date: 2009-03-25 13:44:28 +0000 (Wed, 25 Mar 2009)
Log Message:
-----------
fix immutable handling (fixes 13 tests, to 83/20)
Modified Paths:
--------------
branches/EQ-130/equanda-client/src/main/java/org/equanda/client/ExceptionCodes.java
branches/EQ-130/equanda-client/src/main/resources/org/equanda/translations/translations-common.txt
branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/validator/OtherChoices.java
Modified: branches/EQ-130/equanda-client/src/main/java/org/equanda/client/ExceptionCodes.java
===================================================================
--- branches/EQ-130/equanda-client/src/main/java/org/equanda/client/ExceptionCodes.java 2009-03-25 13:15:22 UTC (rev 1059)
+++ branches/EQ-130/equanda-client/src/main/java/org/equanda/client/ExceptionCodes.java 2009-03-25 13:44:28 UTC (rev 1060)
@@ -59,7 +59,8 @@
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 ECV_CASCADE_KEEP = 91019;
+ int ECV_IMMUTABLE_FIELD_CANNOT_CHANGE_AFTER_CREATE = 91020;
int CME_DATA_HAS_BEEN_ALREADY_CHANGED = 92001;
Modified: branches/EQ-130/equanda-client/src/main/resources/org/equanda/translations/translations-common.txt
===================================================================
--- branches/EQ-130/equanda-client/src/main/resources/org/equanda/translations/translations-common.txt 2009-03-25 13:15:22 UTC (rev 1059)
+++ branches/EQ-130/equanda-client/src/main/resources/org/equanda/translations/translations-common.txt 2009-03-25 13:44:28 UTC (rev 1060)
@@ -113,6 +113,9 @@
.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 910019/equanda-exceptions
+.label.en Immutable field cannot be modified after object creation
+.label.nl Een "immutable" veld kan niet meer gewijzigd worden na creatie
.key 92001/equanda-exceptions
.label.en Data has already changed
.label.nl Data is reeds gewijzigd
Modified: branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm
===================================================================
--- branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-03-25 13:15:22 UTC (rev 1059)
+++ branches/EQ-130/equanda-generate/src/main/velocity/ejb3/ProxyObjectUpdater.java.vm 2009-03-25 13:44:28 UTC (rev 1060)
@@ -29,10 +29,13 @@
}
#set( $hasFields = false )
#foreach( $field in $table.SortedFields )
- #if( !$field.isInternal() && !$field.isImmutable() && !$field.isAuto() && !$field.isCalculated() )
+ #if( !$field.isInternal() && !$field.isAuto() && !$field.isCalculated() )
if ( obj.is${field.Name}Modified() )
{
- DM${field.DmTable.Name} spec = (DM${field.DmTable.Name})entity;
+#if( $field.isImmutable() )
+ if ( null != obj.getId() ) throw new EquandaConstraintViolation(ECV_IMMUTABLE_FIELD_CANNOT_CHANGE_AFTER_CREATE );
+#end
+ DM${field.DmTable.Name} spec = (DM${field.DmTable.Name})entity;
#set( $fieldtype = $field.JavaFieldType )
#set( $lnk = "" )
#set( $hasFields = true )
Modified: branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/validator/OtherChoices.java
===================================================================
--- branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/validator/OtherChoices.java 2009-03-25 13:15:22 UTC (rev 1059)
+++ branches/EQ-130/equanda-test/test-core/src/main/java/org/equanda/test/validator/OtherChoices.java 2009-03-25 13:44:28 UTC (rev 1060)
@@ -41,50 +41,38 @@
public boolean isAllowed( String s )
{
- if ( s == null )
- {
- return false;
- }
- if ( s.equals( "*" ) )
- {
- return true;
- }
- return false;
+ return "*".equals( s );
}
public boolean isAllowed( int i )
{
- if ( i == 12 )
- {
- return true;
- }
- return false;
+ return i == 12;
}
public Collection getAllowedStringProxy()
{
- ArrayList list = new ArrayList();
+ ArrayList<String> list = new ArrayList<String>();
list.add( "*" );
return list;
}
- public Collection getAllowedStringNames()
+ public Collection<String> getAllowedStringNames()
{
- ArrayList list = new ArrayList();
+ ArrayList<String> list = new ArrayList<String>();
list.add( "*" );
return list;
}
public Collection getAllowedIntProxy()
{
- ArrayList list = new ArrayList();
+ ArrayList<String> list = new ArrayList<String>();
list.add( "12" );
return list;
}
- public Collection getAllowedIntNames()
+ public Collection<String> getAllowedIntNames()
{
- ArrayList list = new ArrayList();
+ ArrayList<String> list = new ArrayList<String>();
list.add( "12" );
return list;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|