Project

General

Profile

Revision 3f43c155

ID3f43c15505a4359e40a1945d543f99166913e844
Parent 4bfde47a
Child b362a2c0

Added by Andreas Müller over 2 years ago

cleanup

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v24_25/SchemaUpdater_24_25.java
1 1
// $Id$
2 2
/**
3 3
* Copyright (C) 2009 EDIT
4
* European Distributed Institute of Taxonomy 
4
* European Distributed Institute of Taxonomy
5 5
* http://www.e-taxonomy.eu
6
* 
6
*
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
......
31 31
	private static final Logger logger = Logger.getLogger(SchemaUpdater_24_25.class);
32 32
	private static final String startSchemaVersion = "2.4.1.2.201004231015";
33 33
	private static final String endSchemaVersion = "2.5.0.0.201009211255";
34
	
34

  
35 35
// ********************** FACTORY METHOD *******************************************
36
	
36

  
37 37
	public static SchemaUpdater_24_25 NewInstance(){
38 38
		return new SchemaUpdater_24_25();
39 39
	}
40 40

  
41
	
41

  
42 42
// ********************** CONSTRUCTOR *******************************************/
43
	
43

  
44 44
	private SchemaUpdater_24_25(){
45 45
		super(startSchemaVersion, endSchemaVersion);
46 46
	}
47
	
47

  
48 48
// ************************ NEXT / PREVIOUS **************************************/
49 49

  
50
	/* (non-Javadoc)
51
	 * @see eu.etaxonomy.cdm.database.update.ICdmUpdater#getNextUpdater()
52
	 */
53 50
	@Override
54 51
	public ISchemaUpdater getNextUpdater() {
55 52
		return SchemaUpdater_25_30.NewInstance();
56 53
	}
57 54

  
58
	/* (non-Javadoc)
59
	 * @see eu.etaxonomy.cdm.database.update.ICdmUpdater#getPreviousUpdater()
60
	 */
61 55
	@Override
62 56
	public ISchemaUpdater getPreviousUpdater() {
63 57
		return null;
64 58
	}
65 59

  
66 60
// ************************** UPDATE STEPS ************************************************
67
	
61

  
68 62
	@Override
69 63
	protected List<ISchemaUpdaterStep> getUpdaterList() {
70 64
		List<ISchemaUpdaterStep> stepList = new ArrayList<ISchemaUpdaterStep>();
71 65
		String stepName;
72
		
66

  
73 67
		//sortIndex on children in FeatureNode
74 68
		stepName = "Add sort index on FeatureNode children";
75 69
		ColumnAdder step = ColumnAdder.NewIntegerInstance(stepName, "FeatureNode", "sortindex", INCLUDE_AUDIT, false, null);
76 70
		stepList.add(step);
77
		
71

  
78 72
		//update sortindex on FeatureNode children
79 73
		stepName = "Update sort index on FeatureNode children";
80 74
//		updateQuery = "UPDATE FeatureNode SET sortindex = id WHERE sortindex is null";
......
82 76
//		stepList.add(updateSortindex);
83 77
		SortIndexUpdater updateSortIndex = SortIndexUpdater.NewInstance(stepName, "FeatureNode", "parent_fk", "sortindex", INCLUDE_AUDIT);
84 78
		stepList.add(updateSortIndex);
85
		
79

  
86 80
		//add country to gathering event
87 81
		stepName = "Add country column to gathering event";
88 82
		step = ColumnAdder.NewIntegerInstance(stepName, "GatheringEvent", "country_id", INCLUDE_AUDIT, false, "DefinedTermBase");
......
93 87
		Boolean defaultValue = false;
94 88
		step = ColumnAdder.NewBooleanInstance(stepName, "TaxonBase", "unplaced", INCLUDE_AUDIT, defaultValue);
95 89
		stepList.add(step);
96
		
90

  
97 91
		//add excluded to taxon
98 92
		stepName = "Add excluded to taxon";
99 93
		defaultValue = false;
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v30_31/SchemaUpdater_30_301.java
1 1
// $Id$
2 2
/**
3 3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
4
* European Distributed Institute of Taxonomy
5 5
* http://www.e-taxonomy.eu
6
* 
6
*
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
......
37 37
	private static final Logger logger = Logger.getLogger(SchemaUpdater_30_301.class);
38 38
	private static final String startSchemaVersion = "3.0.0.0.201011090000";
39 39
	private static final String endSchemaVersion = "3.0.1.0.201104190000";
40
	
40

  
41 41
// ********************** FACTORY METHOD *******************************************
42
	
42

  
43 43
	public static SchemaUpdater_30_301 NewInstance(){
44 44
		return new SchemaUpdater_30_301();
45 45
	}
46
	
46

  
47 47
	/**
48 48
	 * @param startSchemaVersion
49 49
	 * @param endSchemaVersion
......
51 51
	protected SchemaUpdater_30_301() {
52 52
		super(startSchemaVersion, endSchemaVersion);
53 53
	}
54
	
55
	/* (non-Javadoc)
56
	 * @see eu.etaxonomy.cdm.database.update.SchemaUpdaterBase#getUpdaterList()
57
	 */
54

  
58 55
	@Override
59 56
	protected List<ISchemaUpdaterStep> getUpdaterList() {
60
		
57

  
61 58
		List<ISchemaUpdaterStep> stepList = new ArrayList<ISchemaUpdaterStep>();
62
		String stepName;
63
		
59

  
64 60
		//drop unique index for DefinedTermBase_media.media_id
65 61
		ISchemaUpdaterStep step = UniqueIndexDropper.NewInstance("DefinedTermBase_media", "media_id", ! INCLUDE_AUDIT);
66 62
		stepList.add(step);
......
74 70
		//this was part of schema version 2.5 but an updater was never written
75 71
		step = UniqueIndexDropper.NewInstance("StatisticalMeasurementValue_definedtermbase", "modifiers_id", ! INCLUDE_AUDIT);
76 72
		stepList.add(step);
77
		
73

  
78 74
		//Makes PolytomousKeyNode parent-child bidirectional
79 75
		step = ColumnAdder.NewIntegerInstance("Add parent_id to PolytomousKeyNode_AUD", "PolytomousKeyNode_AUD", "parent_id", ! INCLUDE_AUDIT, false, "PolytomousKeyNode");
80 76
		stepList.add(step);
81 77
		step = TableDroper.NewInstance("Drop PolytomousKeyNode_PolytomousKeyNode_AUD table", "PolytomousKeyNode_PolytomousKeyNode_AUD", ! INCLUDE_AUDIT);
82 78
		stepList.add(step);
83
		
84
		
79

  
80

  
85 81
		return stepList;
86 82
	}
87 83

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ICommonService.java
286 286
	public Set<CdmBase> getReferencingObjectsForDeletion(CdmBase referencedCdmBase);
287 287

  
288 288
	/**
289
	 * Creates a database that more or less has all tables filled.
289 290
	 * Preliminary, may be moved to test later
290 291
	 */
291 292
	@Deprecated
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/ClassificationServiceDeepTest.java
12 12

  
13 13
import java.io.FileNotFoundException;
14 14
import java.util.Arrays;
15
import java.util.Comparator;
16 15
import java.util.HashMap;
17 16
import java.util.List;
18 17
import java.util.Map;
......
36 35
/**
37 36
 * @author n.hoffmann
38 37
 * @created Sep 22, 2009
39
 * @version 1.0
40 38
 */
41 39
public class ClassificationServiceDeepTest extends CdmTransactionalIntegrationTest{
42 40

  
......
55 53
            "taxon.name.*"
56 54
            });
57 55

  
58
    private Comparator<? super TaxonNode> taxonNodeComparator;
59

  
60

  
61

  
62 56

  
63 57
    @Test
64 58
    @DataSet

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)