View Javadoc

1   /**
2    * This file is part of the equanda project.
3    *
4    * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at http://www.mozilla.org/MPL/
7    *
8    * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
9    * ANY KIND, either express or implied. See the License for the specific language governing rights and
10   * limitations under the License.
11   *
12   * Alternatively, the contents of this file may be used under the terms of
13   * either the GNU General Public License Version 2 or later (the "GPL"), or
14   * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
15   * in which case the provisions of the GPL or the LGPL are applicable instead
16   * of those above. If you wish to allow use of your version of this file only
17   * under the terms of either the GPL or the LGPL, and not to allow others to
18   * use your version of this file under the terms of the MPL, indicate your
19   * decision by deleting the provisions above and replace them with the notice
20   * and other provisions required by the GPL or the LGPL. If you do not delete
21   * the provisions above, a recipient may use your version of this file under
22   * the terms of any one of the MPL, the GPL or the LGPL.
23   */
24  
25  package org.equanda.test.dm.server;
26  
27  import org.equanda.persistence.EquandaPersistenceException;
28  import org.equanda.test.TestExceptionCodes;
29  import org.equanda.test.dm.client.constants.PassportConstants;
30  import org.equanda.test.dm.server.pm.DMAutoFields_MultipleAutoBean;
31  import org.equanda.test.dm.server.pm.DMPassportBean;
32  
33  import java.util.ArrayList;
34  import java.util.Collection;
35  
36  /**
37   * mediator object to overwrite functions for auto fields
38   *
39   * @author NetRom team
40   */
41  public class AutoFieldsMediator
42      extends AutoFieldsMediatorBase
43      implements TestExceptionCodes
44  {
45      protected int autoAutoInt()
46          throws EquandaPersistenceException
47      {
48          return 0;
49      }
50  
51      protected Collection<DMAutoFields_MultipleAutoBean> autoMultipleAuto()
52          throws EquandaPersistenceException
53      {
54          ArrayList<DMAutoFields_MultipleAutoBean> array = new ArrayList<DMAutoFields_MultipleAutoBean>();
55  
56          DMAutoFields_MultipleAutoBean obj = new DMAutoFields_MultipleAutoBean();
57          try
58          {
59              obj.setMultipleAuto( "test" );
60          }
61          catch ( Exception e )
62          {
63              throw new EquandaPersistenceException( EPE_PROBLEM_IN_AUTOMULTIPLEAUTO, e);
64          }
65          array.add( obj );
66          return array;
67      }
68  
69      protected Collection<DMPassportBean> autoMultiplePassport()
70          throws EquandaPersistenceException
71      {
72          ArrayList<DMPassportBean> array = new ArrayList<DMPassportBean>();
73          array.add( new DMPassportBean( PassportConstants.TYPE_Passport ) );
74          return array;
75      }
76  }