Tutti-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- 4058 discussions
r510 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species: . frequency
by kmorin@users.forge.codelutin.com 01 Mar '13
by kmorin@users.forge.codelutin.com 01 Mar '13
01 Mar '13
Author: kmorin
Date: 2013-03-01 18:12:08 +0100 (Fri, 01 Mar 2013)
New Revision: 510
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/510
Log:
fixes #2039 [ESPECE] - Saisie mensurations : Enregistrement des modifications non pris en compte
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-01 11:56:41 UTC (rev 509)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-01 17:12:08 UTC (rev 510)
@@ -942,6 +942,7 @@
SpeciesBatchTableModel tableModel = getTableModel();
SpeciesBatchRowModel row = tableModel.getEntry(rowIndex);
+ int selectedRowCount = getTable().getSelectedRowCount();
if (row.isValid()) {
@@ -959,25 +960,28 @@
// can split if selected batch is a leaf
enableSplit = row.isBatchLeaf()
+ && selectedRowCount == 1
&& row.getComputedNumber() == null;
}
if (enableRename) {
// can rename if selected batch is a parent
- enableRename = row.isBatchRoot();
+ enableRename = row.isBatchRoot()
+ && selectedRowCount == 1;
}
if (enableRemove) {
// can always remove the batch
- enableRemove = true;
+ enableRemove = selectedRowCount == 1;
}
if (enableRemoveSub) {
// can remove sub batch if selected batch is not a leaf
- enableRemoveSub = !row.isBatchLeaf();
+ enableRemoveSub = !row.isBatchLeaf()
+ && selectedRowCount == 1;
}
if (enableCreateMelag) {
@@ -985,11 +989,12 @@
JXTable table = getTable();
// can add species to a melag if several root are selected
- int[] selectedRows = table.getSelectedRows();
- if (selectedRows.length < 2) {
+
+ if (selectedRowCount < 2) {
enableCreateMelag = false;
} else {
+ int[] selectedRows = table.getSelectedRows();
for (int selectedRowIndex : selectedRows) {
SpeciesBatchRowModel selectedRow =
tableModel.getEntry(selectedRowIndex);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css 2013-03-01 11:56:41 UTC (rev 509)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css 2013-03-01 17:12:08 UTC (rev 510)
@@ -8,15 +8,15 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
+ *
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
@@ -98,6 +98,7 @@
useFloat: true;
showReset: true;
numberPattern: {DECIMAL1_PATTERN};
+ enabled: {model.getLengthStepCaracteristic() != null};
}
#generateButton {
@@ -170,7 +171,7 @@
}
#dataFieldLayout {
- selected: {model.isSimpleCountingMode() ? "noLengthCaracteristicPmfm" : "lengthCaracteristicPmfm"};
+ selected: {model.isSimpleCountingMode() ? "noLengthCaracteristicPmfm" : "lengthCaracteristicPmfm"};
}
#dataFieldPanel {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-01 11:56:41 UTC (rev 509)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-01 17:12:08 UTC (rev 510)
@@ -10,15 +10,15 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
+ *
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
@@ -329,6 +329,7 @@
Float minStep = model.getLengthStep(model.getMinStep());
Float maxStep = model.getLengthStep(model.getMaxStep());
+ Caracteristic lengthStepCaracteristic = model.getLengthStepCaracteristic();
for (float i = minStep, step = model.getStep(); i <= maxStep; i += step) {
if (!rowsByStep.containsKey(i)) {
@@ -336,6 +337,7 @@
// add it
SpeciesFrequencyRowModel newRow = tableModel.createNewRow();
newRow.setLengthStep(i);
+ newRow.setLengthStepCaracteristic(lengthStepCaracteristic);
rowsByStep.put(i, newRow);
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java 2013-03-01 11:56:41 UTC (rev 509)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java 2013-03-01 17:12:08 UTC (rev 510)
@@ -10,15 +10,15 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
+ *
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
@@ -150,6 +150,7 @@
Object oldValue = getLengthStepCaracteristic();
this.lengthStepCaracteristic = lengthStepCaracteristic;
firePropertyChange(PROPERTY_LENGHT_STEP_CARACTERISTIC, oldValue, lengthStepCaracteristic);
+ firePropertyChange(PROPERTY_CAN_GENERATE, null, isCanGenerate());
}
public Float getMinStep() {
@@ -201,7 +202,7 @@
}
public boolean isCanGenerate() {
- return minStep != null && maxStep != null && maxStep > minStep;
+ return minStep != null && maxStep != null && maxStep > minStep && lengthStepCaracteristic != null;
}
public SpeciesBatchRowModel getBatch() {
1
0
r509 - trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service
by kmorin@users.forge.codelutin.com 01 Mar '13
by kmorin@users.forge.codelutin.com 01 Mar '13
01 Mar '13
Author: kmorin
Date: 2013-03-01 12:56:41 +0100 (Fri, 01 Mar 2013)
New Revision: 509
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/509
Log:
debug npe
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-03-01 10:53:27 UTC (rev 508)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-03-01 11:56:41 UTC (rev 509)
@@ -10,15 +10,15 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
+ *
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
@@ -178,7 +178,7 @@
SortingBatch benthosBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(),
"pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
- if (benthosBatch == null) {
+ if (benthosBatch != null) {
result.setBenthosTotalUnsortedWeight(benthosBatch.getWeight());
}
@@ -435,14 +435,20 @@
Preconditions.checkNotNull(speciesBatchId);
Preconditions.checkNotNull(frequencies);
+ List<SpeciesBatchFrequency> notNullFrequencies = Lists.newArrayList();
+
// Check that all frequencies have the same length PMFM (before doing any db call)
+ // and remove null frequencies
String pmfmId = null;
for (SpeciesBatchFrequency source : frequencies) {
- if (pmfmId == null) {
- pmfmId = source.getLengthStepCaracteristic().getId();
- } else if (!pmfmId.equals(source.getLengthStepCaracteristic().getId())) {
- throw new DataIntegrityViolationException("Batch frequencies under one Speciesbatch must have all the same lengthStepCaracteristic");
+ if (source.getLengthStepCaracteristic() != null) {
+ if (pmfmId == null) {
+ pmfmId = source.getLengthStepCaracteristic().getId();
+ } else if (!pmfmId.equals(source.getLengthStepCaracteristic().getId())) {
+ throw new DataIntegrityViolationException("Batch frequencies under one Speciesbatch must have all the same lengthStepCaracteristic");
+ }
+ notNullFrequencies.add(source);
}
}
@@ -452,7 +458,7 @@
fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId);
if (catchBatch == null) {
- return frequencies;
+ return notNullFrequencies;
}
// Retrieve parent
@@ -467,7 +473,7 @@
short rankOrder = 0;
List<SortingBatch> batchsToUpdate = Lists.newArrayList();
- for (SpeciesBatchFrequency source : frequencies) {
+ for (SpeciesBatchFrequency source : notNullFrequencies) {
rankOrder++;
// Not existing batch
@@ -510,7 +516,7 @@
getCurrentSession().flush();
- return frequencies;
+ return notNullFrequencies;
}
//------------------------------------------------------------------------//
@@ -1282,7 +1288,7 @@
copyIfNull);
inertBatch.setRankOrder((short) 2);
}
-
+
// -----------------------------------------------------------------------------
// Sorted Vrac > Benthos
// -----------------------------------------------------------------------------
@@ -1298,9 +1304,9 @@
copyIfNull);
benthosBatch.setRankOrder((short) 2);
}
-
+
// TODO plancton, macro déchet...
- }
+ }
}
// -----------------------------------------------------------------------------
@@ -1341,7 +1347,7 @@
copyIfNull);
speciesBatch.setRankOrder((short) 1);
}
-
+
// -----------------------------------------------------------------------------
// Hors Vrac > Benthos :
// -----------------------------------------------------------------------------
1
0
r508 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation/catches/species java/fr/ifremer/tutti/ui/swing/util/table resources/i18n
by kmorin@users.forge.codelutin.com 01 Mar '13
by kmorin@users.forge.codelutin.com 01 Mar '13
01 Mar '13
Author: kmorin
Date: 2013-03-01 11:53:27 +0100 (Fri, 01 Mar 2013)
New Revision: 508
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/508
Log:
fixes #1998 [ESPECE] - Gestion du MELAG
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.jaxx
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java 2013-03-01 10:53:27 UTC (rev 508)
@@ -0,0 +1,163 @@
+
+package fr.ifremer.tutti.ui.swing.content.operation.catches.species;
+
+import com.google.common.collect.Maps;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiAction;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
+import java.awt.Frame;
+import java.awt.event.ActionEvent;
+import java.util.Map;
+import javax.swing.JOptionPane;
+import jaxx.runtime.JAXXUtil;
+import jaxx.runtime.SwingUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.nuiton.util.StringUtil;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ *
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.0.2
+ */
+public class CreateMelagAction extends AbstractTuttiAction<SpeciesBatchUIModel, SpeciesBatchUI, SpeciesBatchUIHandler> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected Map<SpeciesBatchRowModel, Float> selectedRows = Maps.newHashMap();
+
+ protected Float melagWeight = null;
+
+ protected Float sampleMelagWeight = null;
+
+ protected Float sortedWeight = null;
+
+ public CreateMelagAction(SpeciesBatchUIHandler handler) {
+ super(handler,
+ "createMelag",
+ "batch-rename",
+ _("tutti.action.createMelag"),
+ _("tutti.action.createMelag.tip"),
+ false
+ );
+ }
+
+ @Override
+ protected boolean prepareAction(ActionEvent event) {
+ boolean result = super.prepareAction(event);
+
+ SpeciesBatchUIHandler handler = getHandler();
+ int[] selectedRowIndexes = handler.getTable().getSelectedRows();
+
+ SpeciesBatchTableModel tableModel = handler.getTableModel();
+
+ // sum of the weights already entered by the user
+ Float alreadyKnownWeights = 0f;
+ sortedWeight = 0f;
+
+ for (int selectedRowIndex : selectedRowIndexes) {
+ SpeciesBatchRowModel selectedRow =
+ tableModel.getEntry(selectedRowIndex);
+
+ Float sampleWeight = null;
+ if (selectedRow.getFinestCategory().getCategoryWeight() != null) {
+ alreadyKnownWeights += selectedRow.getFinestCategory().getCategoryWeight();
+
+ } else if (selectedRow.getFinestCategory().getComputedWeight() != null) {
+ alreadyKnownWeights += selectedRow.getFinestCategory().getComputedWeight();
+
+ } else if (selectedRow.getWeight() != null) {
+ sampleWeight = selectedRow.getWeight();
+
+ } else {
+ sampleWeight = 0f;
+ if (selectedRow.getFrequency() != null) {
+ for (SpeciesFrequencyRowModel frequency : selectedRow.getFrequency()) {
+ if (frequency.getWeight() == null) {
+ sampleWeight = 0f;
+ break;
+ }
+ sampleWeight += frequency.getWeight();
+ }
+ }
+ }
+
+ if (sampleWeight != null) {
+ if (sampleWeight == 0f) {
+ JOptionPane.showMessageDialog(
+ getUI(),
+ _("tutti.dialog.createMelag.error.message", selectedRowIndex + 1),
+ _("tutti.dialog.createMelag.error.title"),
+ JOptionPane.ERROR_MESSAGE);
+
+ handler.getTable().getSelectionModel().setSelectionInterval(selectedRowIndex, selectedRowIndex);
+ result = false;
+ break;
+
+ } else {
+ sortedWeight += sampleWeight;
+ }
+ }
+
+ selectedRows.put(selectedRow, sampleWeight);
+ }
+
+ if (result) {
+ melagWeight = openMelagWeightDialog();
+
+ if (melagWeight != null) {
+ // substract the weights that the user already entered
+ // they must not be used to compute the other weights
+ sampleMelagWeight = melagWeight - alreadyKnownWeights;
+ }
+ }
+
+ return result && melagWeight != null;
+ }
+
+ protected Float openMelagWeightDialog() {
+ Frame frame = SwingUtil.getParentContainer(getUI(), Frame.class);
+
+ final EnterMelagWeightDialog dialog = new EnterMelagWeightDialog(frame,
+ getConfig().getShortcutClosePopup());
+ SwingUtil.center(frame, dialog);
+ dialog.pack();
+ dialog.setVisible(true);
+
+ Float result = null;
+ if (dialog.getEditor().getModel() != null) {
+ result = dialog.getEditor().getModel().floatValue();
+ }
+ return result;
+ }
+
+ @Override
+ protected void doAction(ActionEvent event) throws Exception {
+ for (SpeciesBatchRowModel batch : selectedRows.keySet()) {
+ Float sampleWeight = selectedRows.get(batch);
+ if (sampleWeight != null) {
+ Float weight = sampleMelagWeight * sampleWeight / sortedWeight;
+ batch.getFinestCategory().setCategoryWeight(weight);
+ }
+ String comment = batch.getComment();
+ if (StringUtils.isBlank(comment)) {
+ comment = "";
+
+ } else {
+ comment += "\n";
+ }
+ comment += "issu d'un MELAG de " + melagWeight + "kg";
+ batch.setComment(comment);
+ }
+ getHandler().saveRows(selectedRows.keySet());
+ }
+
+ @Override
+ protected void releaseAction(ActionEvent event) {
+ super.releaseAction(event);
+ getHandler().getTable().repaint();
+ selectedRows.clear();
+ melagWeight = null;
+ sortedWeight = null;
+ }
+}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.css 2013-03-01 10:53:27 UTC (rev 508)
@@ -0,0 +1,25 @@
+#dialog {
+ title: "tutti.dialog.createMelag.title";
+}
+
+#message {
+ text: "tutti.dialog.createMelag.message";
+ horizontalAlignment: {JLabel.CENTER};
+}
+
+#editor {
+ useFloat: true;
+ useSign: false;
+ autoPopup: true;
+ showPopupButton: true;
+ showReset: true;
+}
+
+#cancelButton {
+ text: "tutti.action.cancel";
+}
+
+#validateButton {
+ text: "tutti.action.validate";
+ enabled: { editor.getModel() != null };
+}
\ No newline at end of file
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.jaxx 2013-03-01 10:53:27 UTC (rev 508)
@@ -0,0 +1,49 @@
+<JDialog id='dialog' layout='{new BorderLayout()}'>
+ <import>
+ java.awt.Component;
+ java.awt.event.WindowAdapter;
+ java.awt.event.WindowEvent;
+ javax.swing.JComponent
+ javax.swing.JRootPane;
+ javax.swing.KeyStroke;
+ jaxx.runtime.swing.editor.NumberEditor
+ </import>
+
+ <script><![CDATA[
+
+public EnterMelagWeightDialog(Frame frame, KeyStroke shortcutClosePopup) {
+ super(frame, true);
+
+ // add a auto-close action
+ rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
+ shortcutClosePopup, "close");
+
+ addWindowListener(new WindowAdapter() {
+
+ @Override
+ public void windowClosed(WindowEvent e) {
+ Component ui = (Component) e.getSource();
+ JAXXUtil.destroy(ui);
+ }
+ });
+}
+
+ ]]></script>
+
+ <Table id='table' fill='both' constraints='BorderLayout.CENTER'>
+ <row>
+ <cell insets='10, 10, 5, 10'>
+ <JLabel id='message'/>
+ </cell>
+ </row>
+ <row>
+ <cell insets='5, 10, 10, 10'>
+ <NumberEditor id='editor'/>
+ </cell>
+ </row>
+ </Table>
+ <JPanel layout='{new GridLayout(1,0)}' constraints='BorderLayout.SOUTH'>
+ <JButton id='cancelButton' onActionPerformed='editor.setModel(null); dispose();'/>
+ <JButton id='validateButton' onActionPerformed='dispose();'/>
+ </JPanel>
+</JDialog>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-03-01 09:33:34 UTC (rev 507)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-03-01 10:53:27 UTC (rev 508)
@@ -8,15 +8,15 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
+ *
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
@@ -131,8 +131,13 @@
enabled: {model.isTableViewModeAll() && model.isRenameSpeciesBatchEnabled()};
}
+#createMelag {
+ _tuttiAction: {CreateMelagAction.class};
+ enabled: {!model.isTableViewModeLeaf() && model.isCreateMelagEnabled()};
+}
+
#table {
- selectionMode: {ListSelectionModel.SINGLE_SELECTION};
+ selectionMode: {ListSelectionModel.MULTIPLE_INTERVAL_SELECTION};
selectionBackground: {null};
selectionForeground: {Color.BLACK};
sortable: false;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-03-01 09:33:34 UTC (rev 507)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-03-01 10:53:27 UTC (rev 508)
@@ -84,6 +84,7 @@
<JMenuItem id='removeSpeciesBatchMenu'/>
<JMenuItem id='removeSpeciesSubBatchMenu'/>
<JMenuItem id='renameSpeciesBatchMenu'/>
+ <JMenuItem id='createMelag'/>
</JPopupMenu>
<Table id='form' fill='both' constraints='BorderLayout.NORTH'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-01 09:33:34 UTC (rev 507)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-01 10:53:27 UTC (rev 508)
@@ -10,15 +10,15 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
+ *
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
@@ -83,10 +83,12 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.Serializable;
+import java.util.Arrays;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import javax.swing.UIManager;
import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
@@ -634,7 +636,6 @@
new HighlightPredicate() {
public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
- int rowIndex = adapter.convertRowIndexToModel(adapter.row);
SpeciesBatchRowModel row = getTableModel().getEntry(adapter.row);
return row.getSpeciesToConfirm();
}
@@ -644,12 +645,20 @@
initBatchTable(table, columnModel, tableModel);
+ // highlight only the species column if the row is selected
+ Highlighter selectedHighlighter = TuttiUIUtil.newBackgroundColorHighlighter(
+ new HighlightPredicate.AndHighlightPredicate(
+ HighlightPredicate.IS_SELECTED,
+ new HighlightPredicate.IdentifierHighlightPredicate(SpeciesBatchTableModel.SPECIES)),
+ UIManager.getColor("Table[Enabled+Selected].textBackground"));
+
+ table.addHighlighter(selectedHighlighter);
+
// paint the cell in dark orange if the row is to confirm and the cell is not editable
attachmentHighlighter = TuttiUIUtil.newBackgroundColorHighlighter(
new HighlightPredicate() {
public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
- int rowIndex = adapter.convertRowIndexToModel(adapter.row);
SpeciesBatchRowModel row = getTableModel().getEntry(adapter.row);
return row.getSpeciesToConfirm() && !adapter.isEditable();
}
@@ -841,7 +850,7 @@
}
- protected void saveRows(Iterable<SpeciesBatchRowModel> rows) {
+ public void saveRows(Iterable<SpeciesBatchRowModel> rows) {
for (SpeciesBatchRowModel row : rows) {
saveRow(row);
}
@@ -910,44 +919,6 @@
row.setFrequency(frequencyRows);
}
- protected void recomputeTotalUnsortedWeight() {
-
- // recompute total hors vrac
- Float totalHorsVrac = 0f;
- Float totalVrac = 0f;
-
- for (SpeciesBatchRowModel batch : getModel().getRows()) {
- CaracteristicQualitativeValue vracHorsVrac =
- batch.getSortedUnsortedCategoryValue();
-
- if (vracHorsVrac == null) {
-
- // can't sum anything
- } else {
- boolean unsorted = "unsorted".equals(vracHorsVrac.getName());
- if (unsorted) {
- Float weight = batch.getWeight();
- if (weight != null) {
- totalHorsVrac += weight;
- }
- } else {
- Float weight = batch.getWeight();
- if (weight != null) {
- totalVrac += weight;
- }
- }
- }
- }
- if (log.isInfoEnabled()) {
- log.info("New total vrac / hors vrac: " +
- totalVrac + " / " + totalHorsVrac);
- }
- ui.getSpeciesTotalUnsortedWeightField()
- .setText(JAXXUtil.getStringValue(totalHorsVrac));
- //TODO Should we also set the total vrac weight ?
-// getModel().setTotalVracWeight(totalVrac);
- }
-
protected void recomputeBatchActionEnable() {
int rowIndex = getTable().getSelectedRow();
@@ -960,6 +931,7 @@
boolean enableSplit = false;
boolean enableRemove = false;
boolean enableRemoveSub = false;
+ boolean enableCreateMelag = false;
if (rowIndex != -1) {
@@ -968,7 +940,8 @@
//TODO If there is some sub-batch, can remove them
//TODO If there is no sub-batch, can split current batch
- SpeciesBatchRowModel row = getTableModel().getEntry(rowIndex);
+ SpeciesBatchTableModel tableModel = getTableModel();
+ SpeciesBatchRowModel row = tableModel.getEntry(rowIndex);
if (row.isValid()) {
@@ -979,6 +952,7 @@
enableRemove = true;
enableRemoveSub = true;
enableRename = true;
+ enableCreateMelag = true;
}
if (enableSplit) {
@@ -1005,12 +979,37 @@
// can remove sub batch if selected batch is not a leaf
enableRemoveSub = !row.isBatchLeaf();
}
+
+ if (enableCreateMelag) {
+
+ JXTable table = getTable();
+
+ // can add species to a melag if several root are selected
+ int[] selectedRows = table.getSelectedRows();
+ if (selectedRows.length < 2) {
+ enableCreateMelag = false;
+
+ } else {
+ for (int selectedRowIndex : selectedRows) {
+ SpeciesBatchRowModel selectedRow =
+ tableModel.getEntry(selectedRowIndex);
+
+ if (!selectedRow.isBatchRoot()) {
+ enableCreateMelag = false;
+ break;
+ }
+ }
+ }
+ }
}
- getModel().setCreateSpeciesBatchEnabled(enableAdd);
- getModel().setSplitSpeciesBatchEnabled(enableSplit);
- getModel().setRemoveSpeciesBatchEnabled(enableRemove);
- getModel().setRemoveSpeciesSubBatchEnabled(enableRemoveSub);
- getModel().setRenameSpeciesBatchEnabled(enableRename);
+
+ SpeciesBatchUIModel model = getModel();
+ model.setCreateSpeciesBatchEnabled(enableAdd);
+ model.setSplitSpeciesBatchEnabled(enableSplit);
+ model.setRemoveSpeciesBatchEnabled(enableRemove);
+ model.setRemoveSpeciesSubBatchEnabled(enableRemoveSub);
+ model.setRenameSpeciesBatchEnabled(enableRename);
+ model.setCreateMelagEnabled(enableCreateMelag);
}
public void collectChilds(SpeciesBatchRowModel row,
@@ -1161,4 +1160,8 @@
return model.getSelectedSpecies();
}
+
+ public void test() {
+ JOptionPane.showMessageDialog(ui, Arrays.toString(getTable().getSelectedRows()));
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-03-01 09:33:34 UTC (rev 507)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-03-01 10:53:27 UTC (rev 508)
@@ -10,15 +10,15 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
+ *
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
@@ -56,6 +56,8 @@
public static final String PROPERTY_REMOVE_SPECIES_BATCH_ENABLED = "removeSpeciesBatchEnabled";
+ public static final String PROPERTY_CREATE_MELAG_ENABLED = "createMelagEnabled";
+
public static final String PROPERTY_TABLE_VIEW_MODE_ALL = "tableViewModeAll";
public static final String PROPERTY_TABLE_VIEW_MODE_LEAF = "tableViewModeLeaf";
@@ -123,6 +125,13 @@
*/
protected boolean removeSpeciesSubBatchEnabled;
+ /**
+ * Can user create a melag from the selected species?
+ *
+ * @since 0.3
+ */
+ protected boolean createMelagEnabled = true;
+
/** @since 1.0 */
protected int rootNumber;
@@ -148,7 +157,7 @@
public void setSpeciesTotalComputedWeight(Float speciesTotalComputedWeight) {
catchesUIModel.setSpeciesTotalComputedWeight(speciesTotalComputedWeight);
}
-
+
public TuttiComputedOrNotData<Float> getSpeciesTotalSortedComputedOrNotWeight() {
return catchesUIModel.getSpeciesTotalSortedComputedOrNotWeight();
}
@@ -176,7 +185,7 @@
public void setSpeciesTotalUnsortedComputedWeight(Float speciesTotalUnsortedComputedWeight) {
catchesUIModel.setSpeciesTotalUnsortedComputedWeight(speciesTotalUnsortedComputedWeight);
}
-
+
public Float getSpeciesTotalSampleSortedComputedWeight() {
return catchesUIModel.getSpeciesTotalSampleSortedComputedWeight();
}
@@ -184,7 +193,7 @@
public void setSpeciesTotalSampleSortedComputedWeight(Float speciesTotalSampleSortedComputedWeight) {
catchesUIModel.setSpeciesTotalSampleSortedComputedWeight(speciesTotalSampleSortedComputedWeight);
}
-
+
public Float getSpeciesTotalInertWeight() {
return catchesUIModel.getSpeciesTotalInertWeight();
}
@@ -317,4 +326,15 @@
public boolean isRenameSpeciesBatchEnabled() {
return renameSpeciesBatchEnabled;
}
+
+ public boolean isCreateMelagEnabled() {
+ return createMelagEnabled;
+ }
+
+ public void setCreateMelagEnabled(boolean createMelagEnabled) {
+ Object oldValue = isCreateMelagEnabled();
+ this.createMelagEnabled = createMelagEnabled;
+ firePropertyChange(PROPERTY_CREATE_MELAG_ENABLED, oldValue, createMelagEnabled);
+ }
+
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-03-01 09:33:34 UTC (rev 507)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-03-01 10:53:27 UTC (rev 508)
@@ -10,15 +10,15 @@
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
+ * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
+ *
+ * You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
@@ -73,6 +73,7 @@
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.util.Arrays;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
@@ -302,7 +303,8 @@
new HighlightPredicate.AndHighlightPredicate(
new MyIdentifierHighlightPredicate(SpeciesBatchTableModel.COMMENT),
// for not null value
- new HighlightPredicate.NotHighlightPredicate(new HighlightPredicate.EqualsHighlightPredicate())
+ new HighlightPredicate.NotHighlightPredicate(new HighlightPredicate.EqualsHighlightPredicate()),
+ new HighlightPredicate.NotHighlightPredicate(new HighlightPredicate.EqualsHighlightPredicate(""))
), cellWithValueColor);
table.addHighlighter(commentHighlighter);
@@ -678,6 +680,8 @@
JXTable source = (JXTable) e.getSource();
+ int[] selectedRows = source.getSelectedRows();
+
// get the row index at this point
int rowIndex = source.rowAtPoint(p);
@@ -704,7 +708,7 @@
// select row (could empty selection)
if (rowIndex == -1) {
source.clearSelection();
- } else {
+ } else if (!ArrayUtils.contains(selectedRows, rowIndex)) {
source.setRowSelectionInterval(rowIndex, rowIndex);
}
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-03-01 09:33:34 UTC (rev 507)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-03-01 10:53:27 UTC (rev 508)
@@ -44,6 +44,8 @@
tutti.action.computeWeights.tip=Elever les poids
tutti.action.configuration=Configuration
tutti.action.configuration.tip=Configurer Tutti
+tutti.action.createMelag=Èspèces d'un MELAG
+tutti.action.createMelag.tip=Calcul des poids des lots appartenant à un MELAG
tutti.action.createSpeciesBatch=Créer un lot pour une espèce
tutti.action.deleteProtocol=Supprimer
tutti.action.deleteProtocol.message=Vous êtes sur le point de supprimer le protocol %s
@@ -185,6 +187,10 @@
tutti.dialog.catches.species.computeWeight.error.title=Erreur
tutti.dialog.catches.species.split.weightNotNull.message=Pour catégoriser un lot, il ne doit pas avoir de poids sous-échantillonné. Catégoriser le lot mettra le poids sous-échantillonné à nul.
tutti.dialog.catches.species.split.weightNotNull.title=Poids sous-échantillonné non nul
+tutti.dialog.createMelag.error.message=Erreur à la ligne %s
+tutti.dialog.createMelag.error.title=Erreur
+tutti.dialog.createMelag.message=Combien pesait le MELAG (kg) ?
+tutti.dialog.createMelag.title=Poids du MELAG (kg)
tutti.duration.format=dj Hh m'm'
tutti.error.errorpane.htmlmessage=<html><body><b>Une erreur s'est produite</b>\:<br/>%s</body></html>
tutti.file.csv=Extension d'un fichier csv
1
0
See <http://ci.nuiton.org/jenkins/job/tutti/412/changes>
Changes:
[blavenier] Add :
- some caches
- remove HQL on changeSpeciesBatchSpecies (move in 'adagio-core')
Fix :
- move come cache declaration into Interface
------------------------------------------
[...truncated 28 lines...]
projectStarted fr.ifremer:tutti:1.0.2-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti 1.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
mojoStarted org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target>
mojoSucceeded org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
mojoStarted org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (check-project-files) @ tutti ---
mojoSucceeded org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
mojoStarted org.apache.maven.plugins:maven-antrun-plugin:1.7(generate-surefire-workdir)
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ tutti ---
[INFO] Executing tasks
main:
mojoSucceeded org.apache.maven.plugins:maven-antrun-plugin:1.7(generate-surefire-workdir) [mkdir] Created dir: <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/surefire-workdir>
[INFO] Executed tasks
mojoStarted org.apache.maven.plugins:maven-site-plugin:3.2(attach-descriptor)
[INFO]
[INFO] --- maven-site-plugin:3.2:attach-descriptor (attach-descriptor) @ tutti ---
mojoSucceeded org.apache.maven.plugins:maven-site-plugin:3.2(attach-descriptor)
mojoStarted org.apache.maven.plugins:maven-install-plugin:2.4(default-install)
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ tutti ---
[INFO] Installing <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml> to /var/local/maven/data/repository/fr/ifremer/tutti/1.0.2-SNAPSHOT/tutti-1.0.2-SNAPSHOT.pom
[INFO] Installing <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-1.0.2-SNAPSHOT…> to /var/local/maven/data/repository/fr/ifremer/tutti/1.0.2-SNAPSHOT/tutti-1.0.2-SNAPSHOT-site_fr.xml
mojoSucceeded org.apache.maven.plugins:maven-install-plugin:2.4(default-install)
projectSucceeded fr.ifremer:tutti:1.0.2-SNAPSHOT
projectStarted fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: Persistence 1.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils… (2 KB at 1.8 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-… (2 KB at 1.8 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-… (823 B at 6.0 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils… (823 B at 5.6 KB/sec)
mojoStarted org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-persistence ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target>
mojoSucceeded org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
mojoStarted org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (check-project-files) @ tutti-persistence ---
mojoSucceeded org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
mojoStarted org.nuiton.eugene:eugene-maven-plugin:2.6.1(default)
[INFO]
[INFO] --- eugene-maven-plugin:2.6.1:generate (default) @ tutti-persistence ---
[INFO] Process phase [zargo] for one entry.
[INFO] Expanding 1 xmi file(s) from <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…> to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Generate one file in 958.786ms.
[INFO] Process phase [xmi] for one entry.
[INFO] Processing XSL tranformation on <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…> for 1 file(s).
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…> to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Generate one file in 23.27s.
[INFO] Process phase [model] for one entry.
INFO [pool-1-thread-1] (ObjectModelReader.java:273) loadModelProperties - 19 tag values were succesfull imported from <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Apply generator JavaInterfaceTransformer
[INFO] Apply generator SimpleJavaBeanTransformer
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:911) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.data.Program], already found in class-path.
[INFO] Apply generator JavaEnumerationTransformer
mojoSucceeded org.nuiton.eugene:eugene-maven-plugin:2.6.1(default)
[INFO] No file generated.
[INFO] Add compile source root : <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Add resource root :Resource {targetPath: null, filtering: false, FileSet {directory: <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…,> PatternSet [includes: {}, excludes: {**/*.java}]}}
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:parserJava (scan-sources) @ tutti-persistence ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
forkedProjectStarted fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(get)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:get (get) @ tutti-persistence ---
[INFO] Copying tutti-persistence.properties to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(get)
forkedProjectSucceeded fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:gen (scan-sources) @ tutti-persistence ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[WARNING] bundle fr_FR contains 7/28 empty entries! (use -Di18n.showEmpty to see these entries)
mojoStarted org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO] Copying 0 resource
mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ tutti-persistence ---
[INFO] Compiling 79 source files to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/cl…>
[INFO] -------------------------------------------------------------
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] bootstrap class path not set in conjunction with -source 1.6
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[29,22] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[41,52] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[27,22] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[28,22] [deprecation] ApplicationConfigProvider in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[40,55] [deprecation] ApplicationConfigProvider in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[35,9] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[68,20] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[70,34] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[177,11] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[256,46] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[277,46] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[390,53] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[404,52] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[415,53] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[449,42] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[656,34] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[53,11] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[58,11] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[59,19] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[208,25] error: method removeWithChildren in interface CatchBatchExtendDao cannot be applied to given types;
[ERROR] required: Integer
found: Integer,CatchBatch
reason: actual and formal argument lists differ in length
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[346,29] error: cannot find symbol
[ERROR] symbol: method createSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[372,21] error: cannot find symbol
[ERROR] symbol: method updateSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[400,21] error: cannot find symbol
[ERROR] symbol: method setSortingBatchReferenceTaxon(String,Integer)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[482,29] error: cannot find symbol
[ERROR] symbol: method createSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[488,38] error: cannot find symbol
[ERROR] symbol: method loadSortingBatch(Integer,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[502,22] error: cannot find symbol
[ERROR] symbol: method updateSortingBatch(List<SortingBatch>,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[507,29] error: method removeWithChildren in interface CatchBatchExtendDao cannot be applied to given types;
[ERROR] required: Integer
found: Integer,CatchBatch
reason: actual and formal argument lists differ in length
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[581,29] error: cannot find symbol
[ERROR] symbol: method createSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[607,21] error: cannot find symbol
[ERROR] symbol: method updateSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[723,29] error: cannot find symbol
[ERROR] symbol: method createSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[743,25] error: cannot find symbol
[ERROR] symbol: method updateSortingBatch(List<SortingBatch>,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[748,29] error: method removeWithChildren in interface CatchBatchExtendDao cannot be applied to given types;
[INFO] 32 errors
[INFO] -------------------------------------------------------------
projectFailed fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT
sessionEnded
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Tutti ............................................. SUCCESS [1:28.144s]
[INFO] Tutti :: Persistence .............................. FAILURE [1:13.347s]
[INFO] Tutti :: Service .................................. SKIPPED
[INFO] Tutti :: UI ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:49.095s
[INFO] Finished at: Thu Feb 28 20:35:29 CET 2013
[INFO] Final Memory: 27M/74M
[INFO] ------------------------------------------------------------------------
Projects to build: [MavenProject: fr.ifremer:tutti:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-service:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-ui-swing:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/pom.xml]>
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-service/builds/2013-02-28_20-32-19/archive/fr.ifremer.tutti/tutti-service/1.0.2-SNAPSHOT/tutti-service-1.0.2-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-ui-swing/builds/2013-02-28_20-32-19/archive/fr.ifremer.tutti/tutti-ui-swing/1.0.2-SNAPSHOT/tutti-ui-swing-1.0.2-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-02-28_20-32-19/archive/fr.ifremer/tutti/1.0.2-SNAPSHOT/tutti-1.0.2-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-1.0.2-SNAPSHOT…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-02-28_20-32-19/archive/fr.ifremer/tutti/1.0.2-SNAPSHOT/tutti-1.0.2-SNAPSHOT-site_fr.xml
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-persistence/builds/2013-02-28_20-32-19/archive/fr.ifremer.tutti/tutti-persistence/1.0.2-SNAPSHOT/tutti-persistence-1.0.2-SNAPSHOT.pom
Waiting for Jenkins to finish collecting data
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project tutti-persistence: Compilation failure
cause : Compilation failure
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project tutti-persistence: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:729)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 27 more
Sending e-mails to: tutti-commits(a)list.forge.codelutin.com benoit.lavenier(a)e-is.pro
channel stopped
1
2
01 Mar '13
See <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/4…>
Changes:
[blavenier] Add :
- some caches
- remove HQL on changeSpeciesBatchSpecies (move in 'adagio-core')
Fix :
- move come cache declaration into Interface
------------------------------------------
projectStarted fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: Persistence 1.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils… (2 KB at 1.8 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-… (2 KB at 1.8 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-… (823 B at 6.0 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils… (823 B at 5.6 KB/sec)
mojoStarted org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-persistence ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
mojoSucceeded org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
mojoStarted org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (check-project-files) @ tutti-persistence ---
mojoSucceeded org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
mojoStarted org.nuiton.eugene:eugene-maven-plugin:2.6.1(default)
[INFO]
[INFO] --- eugene-maven-plugin:2.6.1:generate (default) @ tutti-persistence ---
[INFO] Process phase [zargo] for one entry.
[INFO] Expanding 1 xmi file(s) from <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…> to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Generate one file in 958.786ms.
[INFO] Process phase [xmi] for one entry.
[INFO] Processing XSL tranformation on <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…> for 1 file(s).
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…> to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Generate one file in 23.27s.
[INFO] Process phase [model] for one entry.
INFO [pool-1-thread-1] (ObjectModelReader.java:273) loadModelProperties - 19 tag values were succesfull imported from <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Apply generator JavaInterfaceTransformer
[INFO] Apply generator SimpleJavaBeanTransformer
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:911) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.data.Program], already found in class-path.
[INFO] Apply generator JavaEnumerationTransformer
mojoSucceeded org.nuiton.eugene:eugene-maven-plugin:2.6.1(default)
[INFO] No file generated.
[INFO] Add compile source root : <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Add resource root :Resource {targetPath: null, filtering: false, FileSet {directory: <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…,> PatternSet [includes: {}, excludes: {**/*.java}]}}
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:parserJava (scan-sources) @ tutti-persistence ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
forkedProjectStarted fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(get)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:get (get) @ tutti-persistence ---
[INFO] Copying tutti-persistence.properties to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(get)
forkedProjectSucceeded fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:gen (scan-sources) @ tutti-persistence ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[WARNING] bundle fr_FR contains 7/28 empty entries! (use -Di18n.showEmpty to see these entries)
mojoStarted org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO] Copying 0 resource
mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ tutti-persistence ---
[INFO] Compiling 79 source files to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] -------------------------------------------------------------
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] bootstrap class path not set in conjunction with -source 1.6
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[29,22] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[41,52] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[27,22] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[28,22] [deprecation] ApplicationConfigProvider in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[40,55] [deprecation] ApplicationConfigProvider in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[35,9] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[68,20] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[70,34] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[177,11] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[256,46] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[277,46] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[390,53] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[404,52] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[415,53] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[449,42] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[656,34] error: cannot find symbol
[ERROR] symbol: method getCache(String)
location: variable cacheService of type CacheService
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[53,11] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[58,11] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[59,19] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[208,25] error: method removeWithChildren in interface CatchBatchExtendDao cannot be applied to given types;
[ERROR] required: Integer
found: Integer,CatchBatch
reason: actual and formal argument lists differ in length
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[346,29] error: cannot find symbol
[ERROR] symbol: method createSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[372,21] error: cannot find symbol
[ERROR] symbol: method updateSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[400,21] error: cannot find symbol
[ERROR] symbol: method setSortingBatchReferenceTaxon(String,Integer)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[482,29] error: cannot find symbol
[ERROR] symbol: method createSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[488,38] error: cannot find symbol
[ERROR] symbol: method loadSortingBatch(Integer,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[502,22] error: cannot find symbol
[ERROR] symbol: method updateSortingBatch(List<SortingBatch>,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[507,29] error: method removeWithChildren in interface CatchBatchExtendDao cannot be applied to given types;
[ERROR] required: Integer
found: Integer,CatchBatch
reason: actual and formal argument lists differ in length
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[581,29] error: cannot find symbol
[ERROR] symbol: method createSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[607,21] error: cannot find symbol
[ERROR] symbol: method updateSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[723,29] error: cannot find symbol
[ERROR] symbol: method createSortingBatch(SortingBatch,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[743,25] error: cannot find symbol
[ERROR] symbol: method updateSortingBatch(List<SortingBatch>,CatchBatch)
location: variable catchBatchDao of type CatchBatchExtendDao
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[748,29] error: method removeWithChildren in interface CatchBatchExtendDao cannot be applied to given types;
[INFO] 32 errors
[INFO] -------------------------------------------------------------
projectFailed fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT
1
2
Author: tchemit
Date: 2013-03-01 10:33:34 +0100 (Fri, 01 Mar 2013)
New Revision: 507
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/507
Log:
move to last snapshot of adagio
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-03-01 06:20:23 UTC (rev 506)
+++ trunk/pom.xml 2013-03-01 09:33:34 UTC (rev 507)
@@ -136,7 +136,7 @@
<slf4jVersion>1.7.2</slf4jVersion>
- <adagioVersion>3.3.3</adagioVersion>
+ <adagioVersion>3.3.4-SNAPSHOT</adagioVersion>
<msaccessImporterVersion>1.4.1</msaccessImporterVersion>
1
0
r506 - trunk/tutti-service/src/main/java/fr/ifremer/tutti/service
by tchemit@users.forge.codelutin.com 01 Mar '13
by tchemit@users.forge.codelutin.com 01 Mar '13
01 Mar '13
Author: tchemit
Date: 2013-03-01 07:20:23 +0100 (Fri, 01 Mar 2013)
New Revision: 506
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/506
Log:
improve log
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-03-01 06:19:28 UTC (rev 505)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-03-01 06:20:23 UTC (rev 506)
@@ -98,7 +98,7 @@
public void init() {
if (log.isInfoEnabled()) {
- log.info("Open persistence driver " + getImplementationName());
+ log.info("Open persistence service");
}
TuttiServiceConfig serviceConfig = context.getConfig();
@@ -115,31 +115,32 @@
// can use adagio driver
driver = TuttiPersistenceServiceLocator.getPersistenceService();
- if (log.isInfoEnabled()) {
- log.info("Will open persistence driver " + driver.getImplementationName());
- }
} else {
driver = new TuttiPersistenceNoDbImpl();
- if (log.isInfoEnabled()) {
- log.info("Will open persistence driver " +
- driver.getImplementationName());
- }
-
driver.init();
}
+
+ if (log.isInfoEnabled()) {
+ log.info("Persistence driver *" +
+ driver.getImplementationName() + "* opened.");
+ }
}
@Override
public void close() throws IOException {
if (log.isInfoEnabled()) {
- log.info("Will close persistence Service " +
- getImplementationName());
+ log.info("Close persistence Service");
}
IOUtils.closeQuietly(driver);
+
+ if (log.isInfoEnabled()) {
+ log.info("Persistence driver *" +
+ driver.getImplementationName() + "* closed.");
+ }
}
//------------------------------------------------------------------------//
1
0
01 Mar '13
Author: tchemit
Date: 2013-03-01 07:19:28 +0100 (Fri, 01 Mar 2013)
New Revision: 505
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/505
Log:
remove redundant init method
Modified:
trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml
Modified: trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml
===================================================================
--- trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml 2013-02-28 19:20:19 UTC (rev 504)
+++ trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml 2013-03-01 06:19:28 UTC (rev 505)
@@ -31,7 +31,7 @@
<context:component-scan base-package="fr.ifremer.tutti.persistence.service"/>
- <bean id="tuttiPersistence" init-method="init"
+ <bean id="tuttiPersistence"
class="fr.ifremer.tutti.persistence.TuttiPersistenceImpl"/>
<bean id="tuttiEnumerationFile" init-method="init"
1
0
r504 - in trunk/tutti-persistence/src: main/java/fr/ifremer/tutti/persistence/service main/resources test/java/fr/ifremer/tutti/persistence/service
by blavenier@users.forge.codelutin.com 28 Feb '13
by blavenier@users.forge.codelutin.com 28 Feb '13
28 Feb '13
Author: blavenier
Date: 2013-02-28 20:20:19 +0100 (Thu, 28 Feb 2013)
New Revision: 504
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/504
Log:
Add :
- some caches
- remove HQL on changeSpeciesBatchSpecies (move in 'adagio-core')
Fix :
- move come cache declaration into Interface
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml
trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-02-28 11:59:26 UTC (rev 503)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-02-28 19:20:19 UTC (rev 504)
@@ -31,6 +31,7 @@
import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao;
import fr.ifremer.adagio.core.dao.data.batch.SortingBatch;
import fr.ifremer.adagio.core.dao.data.batch.SortingBatchDao;
+import fr.ifremer.adagio.core.dao.data.batch.SortingBatchImpl;
import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchValidationException;
import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchValidator;
import fr.ifremer.adagio.core.dao.data.measure.Measurement;
@@ -82,9 +83,6 @@
@Resource(name = "referentialPersistenceService")
protected ReferentialPersistenceService referentialService;
- @Resource(name = "sortingBatchDao")
- protected SortingBatchDao sortingBatchDao;
-
@Resource(name = "catchBatchDao")
protected CatchBatchExtendDao catchBatchDao;
@@ -157,10 +155,11 @@
// Benthos
SortingBatch benthosBatch = catchBatchDao.getSortingBatch(vracBatch.getChildBatchs(),
"pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
+ if (benthosBatch != null) {
+ result.setBenthosTotalSampleSortedWeight(benthosBatch.getWeight());
+ result.setBenthosTotalSortedWeight(benthosBatch.getWeightBeforeSampling());
+ }
- result.setBenthosTotalSampleSortedWeight(benthosBatch.getWeight());
- result.setBenthosTotalSortedWeight(benthosBatch.getWeightBeforeSampling());
-
// TODO : Plancton...
}
@@ -173,15 +172,17 @@
// Species
SortingBatch speciesBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(),
"pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+ if (speciesBatch != null) {
+ result.setSpeciesTotalUnsortedWeight(speciesBatch.getWeight());
+ }
- result.setSpeciesTotalUnsortedWeight(speciesBatch.getWeight());
-
SortingBatch benthosBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(),
"pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
+ if (benthosBatch == null) {
+ result.setBenthosTotalUnsortedWeight(benthosBatch.getWeight());
+ }
- result.setBenthosTotalUnsortedWeight(benthosBatch.getWeight());
-
// TODO : Plancton...
}
}
@@ -204,7 +205,7 @@
Preconditions.checkNotNull(catchBatch.getChildBatchs());
for (Batch batch : catchBatch.getChildBatchs()) {
- catchBatchDao.removeWithChildren(batch.getId());
+ catchBatchDao.removeWithChildren(batch.getId(), catchBatch);
}
catchBatch.getChildBatchs().clear();
@@ -257,7 +258,6 @@
}
@Override
- @CacheEvict(value = "batchTree", key = "#bean.fishingOperation.id")
public CatchBatch saveCatchBatch(CatchBatch bean) {
Preconditions.checkNotNull(bean);
@@ -343,7 +343,7 @@
SortingBatch batch = SortingBatch.Factory.newInstance();
beanToEntity(bean, batch, parentBatchId, catchBatch, true);
- batch = sortingBatchDao.create(batch);
+ batch = catchBatchDao.createSortingBatch(batch, catchBatch);
bean.setId(String.valueOf(batch.getId()));
@@ -369,7 +369,7 @@
parentBatchId = bean.getParentBatch().getId();
}
beanToEntity(bean, batch, parentBatchId, catchBatch, true);
- sortingBatchDao.update(batch);
+ catchBatchDao.updateSortingBatch(batch, catchBatch);
getCurrentSession().flush();
return bean;
@@ -397,14 +397,7 @@
Preconditions.checkNotNull(species);
Preconditions.checkNotNull(species.getReferenceTaxonId());
- if (log.isDebugEnabled()) {
- log.debug("Changing species for batch id=" + batchId);
- }
-
- int rowUpdated = queryUpdate("updateBatchSpecies",
- "batchId", IntegerType.INSTANCE, Integer.valueOf(batchId),
- "referenceTaxonId", IntegerType.INSTANCE, species.getReferenceTaxonId());
- Preconditions.checkArgument(rowUpdated == 1, "Unable to update operation, to be linked with catch batch.");
+ catchBatchDao.setSortingBatchReferenceTaxon(batchId, species.getReferenceTaxonId());
}
//------------------------------------------------------------------------//
@@ -486,13 +479,13 @@
beanToEntity(source, target, parentBatch, rankOrder, true);
// Create the targeted batch, then update the source id
- sortingBatchDao.create(target);
+ catchBatchDao.createSortingBatch(target, catchBatch);
source.setId(target.getId().toString());
}
// Existing batch
else {
- target = sortingBatchDao.load(Integer.valueOf(source.getId()));
+ target = catchBatchDao.loadSortingBatch(Integer.valueOf(source.getId()), catchBatch);
// Fill the sorting batch from the source
beanToEntity(source, target, parentBatch, rankOrder, true);
@@ -506,12 +499,12 @@
// If some batchs need to be update, do it
if (batchsToUpdate.size() > 0) {
- sortingBatchDao.update(batchsToUpdate);
+ catchBatchDao.updateSortingBatch(batchsToUpdate, catchBatch);
}
if (notUpdatedChildIds.size() > 0) {
for (Integer batchId : notUpdatedChildIds) {
- catchBatchDao.removeWithChildren(batchId);
+ catchBatchDao.removeWithChildren(batchId, catchBatch);
}
}
@@ -585,7 +578,7 @@
SortingBatch batch = SortingBatch.Factory.newInstance();
beanToEntity(bean, batch, parentBatchId, catchBatch, true);
- batch = sortingBatchDao.create(batch);
+ batch = catchBatchDao.createSortingBatch(batch, catchBatch);
bean.setId(String.valueOf(batch.getId()));
@@ -611,7 +604,7 @@
parentBatchId = bean.getParentBatch().getId();
}
beanToEntity(bean, batch, parentBatchId, catchBatch, true);
- sortingBatchDao.update(batch);
+ catchBatchDao.updateSortingBatch(batch, catchBatch);
getCurrentSession().flush();
return bean;
@@ -727,13 +720,13 @@
beanToEntity(source, target, parentBatch, rankOrder, true);
// Create the targeted batch, then update the source id
- sortingBatchDao.create(target);
+ catchBatchDao.createSortingBatch(target, catchBatch);
source.setId(target.getId().toString());
}
// Existing batch
else {
- target = sortingBatchDao.load(Integer.valueOf(source.getId()));
+ target = catchBatchDao.getSortingBatchById(catchBatch, Integer.valueOf(source.getId()));
// Fill the sorting batch from the source
beanToEntity(source, target, parentBatch, rankOrder, true);
@@ -747,12 +740,12 @@
// If some batchs need to be update, do it
if (batchsToUpdate.size() > 0) {
- sortingBatchDao.update(batchsToUpdate);
+ catchBatchDao.updateSortingBatch(batchsToUpdate, catchBatch);
}
if (notUpdatedChildIds.size() > 0) {
for (Integer batchId : notUpdatedChildIds) {
- catchBatchDao.removeWithChildren(batchId);
+ catchBatchDao.removeWithChildren(batchId, catchBatch);
}
}
@@ -1257,7 +1250,6 @@
speciesBatch.setRankOrder((short) 1);
{
-
// -----------------------------------------------------------------------------
// Sorted Vrac / Species / Alive not itemized
// -----------------------------------------------------------------------------
@@ -1290,8 +1282,25 @@
copyIfNull);
inertBatch.setRankOrder((short) 2);
}
- }
- // TODO BL : benthos, plancton, macro déchet...
+
+ // -----------------------------------------------------------------------------
+ // Sorted Vrac > Benthos
+ // -----------------------------------------------------------------------------
+ {
+ SortingBatch benthosBatch = batchChilds.get(enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
+ if (benthosBatch == null) {
+ benthosBatch = SortingBatch.Factory.newInstance();
+ batch.getChildBatchs().add(benthosBatch);
+ }
+ beanToEntitySortingBatch(target, batch, benthosBatch, recorderDepartmentId,
+ enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS,
+ source.getBenthosTotalSampleSortedWeight(), source.getBenthosTotalSortedWeight(),
+ copyIfNull);
+ benthosBatch.setRankOrder((short) 2);
+ }
+
+ // TODO plancton, macro déchet...
+ }
}
// -----------------------------------------------------------------------------
@@ -1313,24 +1322,45 @@
{
Map<Integer, SortingBatch> batchChilds = getChildsMap(batch, enumeration.PMFM_ID_SORTING_TYPE);
- // Species :
- SortingBatch speciesBatch = batchChilds.get(enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
- if (speciesBatch == null) {
- speciesBatch = SortingBatch.Factory.newInstance();
- if (batch.getChildBatchs() == null) {
- batch.setChildBatchs(Lists.newArrayList((Batch) speciesBatch));
- } else {
- batch.getChildBatchs().add(speciesBatch);
- }
+ // -----------------------------------------------------------------------------
+ // Hors Vrac > Species :
+ // -----------------------------------------------------------------------------
+ {
+ SortingBatch speciesBatch = batchChilds.get(enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+ if (speciesBatch == null) {
+ speciesBatch = SortingBatch.Factory.newInstance();
+ if (batch.getChildBatchs() == null) {
+ batch.setChildBatchs(Lists.newArrayList((Batch) speciesBatch));
+ } else {
+ batch.getChildBatchs().add(speciesBatch);
+ }
+ }
+ beanToEntitySortingBatch(target, batch, speciesBatch, recorderDepartmentId,
+ enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES,
+ source.getSpeciesTotalUnsortedWeight(), null,
+ copyIfNull);
+ speciesBatch.setRankOrder((short) 1);
}
- beanToEntitySortingBatch(target, batch, speciesBatch, recorderDepartmentId,
- enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES,
- source.getSpeciesTotalUnsortedWeight(), null,
- copyIfNull);
- speciesBatch.setRankOrder((short) 1);
+
+ // -----------------------------------------------------------------------------
+ // Hors Vrac > Benthos :
+ // -----------------------------------------------------------------------------
+ {
+ SortingBatch benthosBatch = batchChilds.get(enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+ if (benthosBatch == null) {
+ benthosBatch = SortingBatch.Factory.newInstance();
+ batch.getChildBatchs().add(benthosBatch);
+ }
+ beanToEntitySortingBatch(target, batch, benthosBatch, recorderDepartmentId,
+ enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS,
+ source.getBenthosTotalUnsortedWeight(), null,
+ copyIfNull);
+ benthosBatch.setRankOrder((short) 2);
+ }
+
+ // TODO : plancton, macro déchet...
}
- // TODO BL : benthos, plancton, macro déchet...
}
// -----------------------------------------------------------------------------
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java 2013-02-28 11:59:26 UTC (rev 503)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java 2013-02-28 19:20:19 UTC (rev 504)
@@ -26,6 +26,9 @@
import fr.ifremer.tutti.persistence.TuttiPersistenceServiceImplementor;
import fr.ifremer.tutti.persistence.entities.data.Program;
+
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -46,6 +49,7 @@
*
* @return the list of programs found in db.
*/
+ @Cacheable(value = "programs")
List<Program> getAllProgram();
/**
@@ -59,8 +63,10 @@
Program getProgram(String id);
@Transactional(readOnly = false)
+ @CacheEvict(value = {"programs", "programZones"}, allEntries = true)
Program createProgram(Program bean);
@Transactional(readOnly = false)
+ @CacheEvict(value = {"programs", "programZones"}, allEntries = true)
Program saveProgram(Program bean);
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-02-28 11:59:26 UTC (rev 503)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-02-28 19:20:19 UTC (rev 504)
@@ -37,6 +37,9 @@
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
+
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -60,6 +63,7 @@
* @see Program#setZone(Zone)
* @since 0.3
*/
+ @Cacheable(value = "programZones")
List<Zone> getAllProgramZone();
/**
@@ -126,6 +130,7 @@
* @see Cruise#setVessel(List)
* @since 0.3
*/
+ @Cacheable(value = "fishingVessels")
List<Vessel> getAllFishingVessel();
/**
@@ -133,18 +138,21 @@
* @return the vessel
* @since 0.3
*/
+ @Cacheable(value = "vesselByCode", key="#vesselCode")
Vessel getVessel(String vesselCode);
/**
* @return all referent species
* @since 0.3
*/
+ @Cacheable(value = "referentSpecies")
List<Species> getAllReferentSpecies();
/**
* @return all species
* @since 0.3
*/
+ @Cacheable(value = "species")
List<Species> getAllSpecies();
/**
@@ -155,12 +163,14 @@
* @see Species#getReferenceTaxonId()
* @since 0.3
*/
+ @Cacheable(value = "referentSpeciesById", key = "#referenceTaxonId", condition = "#referenceTaxonId != null")
Species getSpeciesByReferenceTaxonId(Integer referenceTaxonId);
/**
* @return all caracteristics of the system.
* @since 1.0
*/
+ @Cacheable(value = "pmfms")
List<Caracteristic> getAllCaracteristic();
/**
@@ -185,12 +195,15 @@
List<Gear> getAllFishingGear();
+ @Cacheable(value = "persons")
List<Person> getAllPerson();
+ @Cacheable(value = "personById", key = "#personId")
Person getPerson(Integer personId);
Gear getGear(Integer gearId);
+ @Cacheable(value = "pmfmById", key = "#pmfmId")
Caracteristic getCaracteristic(Integer pmfmId);
boolean isSortedQualitativeValue(CaracteristicQualitativeValue value);
@@ -204,6 +217,7 @@
* @since 1.0
*/
@Transactional(readOnly = false)
+ @CacheEvict(value = {"species", "referentSpecies", "referentSpeciesById"}, allEntries = true)
List<Species> importTemporarySpecies(List<Species> species);
/**
@@ -213,6 +227,7 @@
* @since 1.0
*/
@Transactional(readOnly = false)
+ @CacheEvict(value = {"fishingVessels", "vesselByCode"}, allEntries = true)
List<Vessel> importTemporaryVessel(List<Vessel> vessels);
/**
@@ -222,6 +237,7 @@
* @since 1.0
*/
@Transactional(readOnly = false)
+ @CacheEvict(value = {"persons", "personById"}, allEntries = true)
List<Person> importTemporaryPerson(List<Person> persons);
/**
@@ -231,6 +247,7 @@
* @since 1.0
*/
@Transactional(readOnly = false)
+ @CacheEvict(value = "gears", allEntries = true)
List<Gear> importTemporaryGear(List<Gear> gears);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-02-28 11:59:26 UTC (rev 503)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-02-28 19:20:19 UTC (rev 504)
@@ -33,6 +33,7 @@
import fr.ifremer.adagio.core.dao.referential.location.LocationExtendDao;
import fr.ifremer.adagio.core.dao.referential.taxon.TaxonNameExtendDao;
import fr.ifremer.adagio.core.dao.referential.taxon.TaxonRefTaxVO;
+import fr.ifremer.adagio.core.service.technical.CacheService;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.referential.AbstractTuttiReferentialEntity;
@@ -47,15 +48,19 @@
import fr.ifremer.tutti.persistence.entities.referential.Status;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
+import net.sf.ehcache.Element;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Query;
import org.hibernate.type.DateType;
import org.hibernate.type.IntegerType;
import org.hibernate.type.StringType;
+import org.springframework.cache.Cache;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
+import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.stereotype.Service;
@@ -97,6 +102,12 @@
@Resource(name = "locationDao")
protected LocationExtendDao locationDao;
+ @Resource(name = "cacheService")
+ protected CacheService cacheService;
+
+ @Resource(name = "referentialPersistenceService")
+ protected ReferentialPersistenceService thisService;
+
//------------------------------------------------------------------------//
//-- ReferentialPersistenceService implentation --//
//------------------------------------------------------------------------//
@@ -242,17 +253,19 @@
"vesselTypeId", IntegerType.INSTANCE, enumeration.VESSEL_TYPE_ID_SCIENTIFIC);
List<Vessel> result = Lists.newArrayList();
+ Cache vesselByCodeCache = cacheService.getCache("vesselByCode");
+
while (list.hasNext()) {
Object[] source = list.next();
- Vessel target = loadVessel(source, true);
-
- result.add(target);
+ Vessel target = loadVessel(source, true);
+ result.add(target);
+ // Add to cache
+ vesselByCodeCache.put(target.getId(), target);
}
return result;
}
@Override
- @Cacheable(value = "fishingVessels")
public List<Vessel> getAllFishingVessel() {
Iterator<Object[]> list = queryListWithStatus(
"allVessels",
@@ -261,11 +274,16 @@
);
List<Vessel> result = Lists.newArrayList();
+ Cache vesselByCodeCache = cacheService.getCache("vesselByCode");
+
while (list.hasNext()) {
Object[] source = list.next();
- Vessel target = loadVessel(source, false);
+ Vessel target = loadVessel(source, true);
target.setScientificVessel(false);
- result.add(target);
+ result.add(target);
+
+ // Add to cache
+ vesselByCodeCache.put(target.getId(), target);
}
return result;
}
@@ -363,37 +381,38 @@
}
@Override
- @Cacheable(value = "species")
public List<Species> getAllSpecies() {
TaxonRefTaxVO[] sources = taxonNameDao.getAllTaxonNames(true);
List<Species> result = Lists.newArrayListWithCapacity(sources.length);
List<Species> referenceTaxonsOnly = Lists.newArrayList();
+ Cache referentSpeciesByIdCache = cacheService.getCache("referentSpeciesById");
for (TaxonRefTaxVO source : sources) {
Species target = loadSpecies(source);
if (target.isReferenceTaxon()) {
// Add to cache :
- putToSpeciesReferentCache(target.getReferenceTaxonId(), target);
+ referentSpeciesByIdCache.put(target.getReferenceTaxonId(), target);
+
referenceTaxonsOnly.add(target);
}
result.add(target);
}
// Add to cache :
- putToSpeciesReferentCache(referenceTaxonsOnly);
+ Cache allReferentSpeciesCache = cacheService.getCache("referentSpecies");
+ allReferentSpeciesCache.put("", referenceTaxonsOnly);
return result;
}
@Override
- @Cacheable(value = "referentSpecies")
public List<Species> getAllReferentSpecies() {
TaxonRefTaxVO[] sources = taxonNameDao.getAllTaxonNames(false);
-
List<Species> result = Lists.newArrayListWithCapacity(sources.length);
+ Cache referentSpeciesByIdCache = cacheService.getCache("referentSpeciesById");
for (TaxonRefTaxVO source : sources) {
if (36403 == source.getTaxonNameId() || 34539 == source.getTaxonNameId()) {
continue;
@@ -401,7 +420,7 @@
Species target = loadSpecies(source);
// Add to cache :
- putToSpeciesReferentCache(target.getReferenceTaxonId(), target);
+ referentSpeciesByIdCache.put(target.getReferenceTaxonId(), target);
result.add(target);
}
@@ -409,7 +428,6 @@
}
@Override
- @Cacheable(value = "referentSpecies", key = "#speciesId")
public Species getSpeciesByReferenceTaxonId(Integer speciesId) {
Species target;
try {
@@ -423,26 +441,21 @@
}
@Override
- @Cacheable(value = "pmfms")
public List<Caracteristic> getAllCaracteristic() {
Iterator<Object[]> sources = queryListWithStatus(
"allPmfm",
"unitIdNone", IntegerType.INSTANCE, enumeration.UNIT_ID_NONE);
List<Caracteristic> result = Lists.newArrayList();
+ Cache pmfmByIdCache = cacheService.getCache("pmfmById");
while (sources.hasNext()) {
Object[] source = sources.next();
Integer pmfmId = (Integer) source[0];
+ Caracteristic target = loadCaracteristic(source);
// Skip some protected PSFM
- if (!isProtectedCaracteristic(pmfmId)) {
- Caracteristic target = loadCaracteristic(source);
- putToCaracteristicCache(pmfmId, target);
-
+ if (!isProtectedCaracteristic(pmfmId)) {
result.add(target);
}
- // If protected, load anyway just for the cache
- else {
- putToCaracteristicCache(pmfmId, loadCaracteristic(source));
- }
+ pmfmByIdCache.put(pmfmId, target);
}
return result;
}
@@ -476,7 +489,7 @@
@Override
public Caracteristic getSortedUnsortedCaracteristic() {
Integer pmfmId = enumeration.PMFM_ID_SORTED_UNSORTED;
- Caracteristic result = getCaracteristic(pmfmId);
+ Caracteristic result = thisService.getCaracteristic(pmfmId);
// Search the qualitative value to skip
for (CaracteristicQualitativeValue qv : result.getQualitativeValue()) {
@@ -492,26 +505,25 @@
@Override
public Caracteristic getMaturityCaracteristic() {
Integer pmfmId = enumeration.PMFM_ID_MATURITY;
- Caracteristic result = getCaracteristic(pmfmId);
+ Caracteristic result = thisService.getCaracteristic(pmfmId);
return result;
}
@Override
public Caracteristic getMacroWasteCategoryCaracteristic() {
Integer pmfmId = enumeration.PMFM_ID_MARINE_LITTER_TYPE;
- Caracteristic result = getCaracteristic(pmfmId);
+ Caracteristic result = thisService.getCaracteristic(pmfmId);
return result;
}
@Override
public Caracteristic getMacroWasteSizeCategoryCaracteristic() {
Integer pmfmId = enumeration.PMFM_ID_MARINE_LITTER_SIZE_CATEGORY;
- Caracteristic result = getCaracteristic(pmfmId);
+ Caracteristic result = thisService.getCaracteristic(pmfmId);
return result;
}
@Override
- @Cacheable(value = "pmfms", key = "#pmfmId")
public Caracteristic getCaracteristic(Integer pmfmId) {
Object[] source = queryUniqueWithStatus("pmfmById",
"pmfmId", IntegerType.INSTANCE, pmfmId,
@@ -521,7 +533,6 @@
}
@Override
- @CacheEvict(value = {"species", "referentSpecies"}, allEntries = true)
public List<Species> importTemporarySpecies(List<Species> species) {
List<Species> result = Lists.newArrayList();
for (Species source : species) {
@@ -532,7 +543,6 @@
}
@Override
- @CacheEvict(value = "fishingVessels", allEntries = true)
public List<Vessel> importTemporaryVessel(List<Vessel> vessels) {
List<Vessel> result = Lists.newArrayList();
@@ -554,7 +564,6 @@
}
@Override
- @CacheEvict(value = "persons", allEntries = true)
public List<Person> importTemporaryPerson(List<Person> persons) {
List<Person> result = Lists.newArrayList();
@@ -568,7 +577,6 @@
}
@Override
- @CacheEvict(value = "gears", allEntries = true)
public List<Gear> importTemporaryGear(List<Gear> gears) {
List<Gear> result = Lists.newArrayList();
@@ -645,7 +653,8 @@
Species result = loadSpecies(taxonName);
// Add to cache
- putToSpeciesReferentCache(Integer.valueOf(result.getId()), result);
+ Cache cache = cacheService.getCache("referentSpeciesById");
+ cache.put(Integer.valueOf(result.getId()), result);
return result;
}
@@ -878,22 +887,4 @@
}
return sampleCategory;
}
-
- @Cacheable(value = "pmfms", key = "#pmfmId")
- protected Caracteristic putToCaracteristicCache(Integer pmfmId, Caracteristic caracteristic) {
- return caracteristic;
- }
-
- @CachePut(value = "referentSpecies")
- protected List<Species> putToSpeciesReferentCache(List<Species> species) {
-
-
- return species;
- }
-
- @CachePut(value = "referentSpecies", key = "#speciesId")
- protected Species putToSpeciesReferentCache(Integer speciesId, Species species) {
- return species;
- }
-
}
Modified: trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml
===================================================================
--- trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml 2013-02-28 11:59:26 UTC (rev 503)
+++ trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml 2013-02-28 19:20:19 UTC (rev 504)
@@ -52,46 +52,83 @@
<property name="diskPersistent" value="false"/>
<property name="diskExpiryThreadIntervalSeconds" value="300"/>
</bean>
-
- <bean id="tuttiBatchTreeCache" parent="tuttiAbstractCache">
- <property name="cacheName" value="batchTree" />
- </bean>
-
+
<!-- Eternal caches : -->
<bean id="tuttiAbstractEternalCache" abstract="true" parent="tuttiAbstractCache">
<property name="eternal" value="true"/>
<property name="overflowToDisk" value="true"/>
+ <property name="maxElementsOnDisk" value="5000"/>
<property name="diskPersistent" value="true"/>
<!-- removed inherited properties -->
<property name="timeToLive" value="0"/>
<property name="timeToIdle" value="0"/>
+ <property name="diskExpiryThreadIntervalSeconds" value="0"/>
</bean>
+ <bean id="tuttiProgramsCache" parent="tuttiAbstractEternalCache">
+ <property name="cacheName" value="programs" />
+ <property name="maxElementsInMemory" value="1"/>
+ <property name="maxElementsOnDisk" value="1"/>
+ </bean>
+
+ <bean id="tuttiProgramZonesCache" parent="tuttiAbstractEternalCache">
+ <property name="cacheName" value="programZones" />
+ <property name="maxElementsInMemory" value="1"/>
+ <property name="maxElementsOnDisk" value="1"/>
+ </bean>
+
<bean id="tuttiPmfmsCache" parent="tuttiAbstractEternalCache">
<property name="cacheName" value="pmfms" />
</bean>
+ <bean id="tuttiPmfmByIdCache" parent="tuttiAbstractEternalCache">
+ <property name="cacheName" value="pmfmById" />
+ </bean>
<bean id="tuttiFishingVesselsCache" parent="tuttiAbstractEternalCache">
<property name="cacheName" value="fishingVessels" />
+ <property name="maxElementsInMemory" value="1"/>
+ <property name="maxElementsOnDisk" value="1"/>
</bean>
+ <bean id="tuttiFishingVesselByCodeCache" parent="tuttiAbstractEternalCache">
+ <property name="cacheName" value="vesselByCode" />
+ <property name="maxElementsInMemory" value="40000"/>
+ <property name="maxElementsOnDisk" value="40000"/>
+ </bean>
<bean id="tuttiSpeciesCache" parent="tuttiAbstractEternalCache">
<property name="cacheName" value="species" />
- <property name="maxElementsInMemory" value="20000"/>
+ <property name="maxElementsInMemory" value="1"/>
+ <property name="maxElementsOnDisk" value="1"/>
</bean>
<bean id="tuttiReferentSpeciesCache" parent="tuttiAbstractEternalCache">
<property name="cacheName" value="referentSpecies" />
- <property name="maxElementsInMemory" value="10000"/>
+ <property name="maxElementsInMemory" value="1"/>
+ <property name="maxElementsOnDisk" value="1"/>
</bean>
+ <bean id="tuttiReferentSpeciesByIdCache" parent="tuttiAbstractEternalCache">
+ <property name="cacheName" value="referentSpeciesById" />
+ <property name="maxElementsInMemory" value="20000"/>
+ <property name="maxElementsOnDisk" value="20000"/>
+ </bean>
<bean id="tuttiGearsCache" parent="tuttiAbstractEternalCache">
<property name="cacheName" value="gears" />
+ <property name="maxElementsInMemory" value="1"/>
+ <property name="maxElementsOnDisk" value="1"/>
</bean>
<bean id="tuttiPersonsCache" parent="tuttiAbstractEternalCache">
<property name="cacheName" value="persons" />
+ <property name="maxElementsInMemory" value="1"/>
+ <property name="maxElementsOnDisk" value="1"/>
</bean>
+
+ <bean id="tuttiPersonByIdCache" parent="tuttiAbstractEternalCache">
+ <property name="cacheName" value="personById" />
+ <property name="maxElementsInMemory" value="1000"/>
+ <property name="maxElementsOnDisk" value="1000"/>
+ </bean>
<!-- Example to use to create a new cache area :
<bean id="tuttiOtherCache" parent="tuttiPersistenceDefaultCache">
Modified: trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-02-28 11:59:26 UTC (rev 503)
+++ trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-02-28 19:20:19 UTC (rev 504)
@@ -328,16 +328,6 @@
<query-param name="pmfmIdSortingType" type="java.lang.Integer"/>
</query>
- <query name="updateBatchSpecies">
- <![CDATA[
- UPDATE SortingBatchImpl b
- SET b.referenceTaxon.id=:referenceTaxonId
- WHERE
- b.id=:batchId
- ]]>
- <query-param name="referenceTaxonId" type="java.lang.Integer"/>
- <query-param name="batchId" type="java.lang.Integer"/>
- </query>
<query name="allSpeciesBatchFrequency">
<![CDATA[
@@ -566,11 +556,10 @@
WHERE
v.vesselType.id = :vesselTypeId
AND v.status.code IN (:statusValidCode, :statusTemporaryCode)
- AND NOT(coalesce(vrp.endDateTime, '2999-12-31 00:00:00') < coalesce(:refDate,sysdate)
- OR vrp.vesselRegistrationPeriodPk.startDateTime > coalesce(:refDate,sysdate)
- )
- AND NOT(coalesce(vf.endDateTime, '2999-12-31 00:00:00') < coalesce(:refDate,sysdate)
- OR vf.startDateTime > coalesce(:refDate,sysdate)
+ AND vrp.vesselRegistrationPeriodPk.startDateTime <= :refDate
+ AND vf.startDateTime <= :refDate
+ AND coalesce(vrp.endDateTime, :refDate) >= :refDate
+ AND coalesce(vf.endDateTime, :refDate) >= :refDate
)
]]>
<query-param name="vesselTypeId" type="java.lang.Integer"/>
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java 2013-02-28 11:59:26 UTC (rev 503)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java 2013-02-28 19:20:19 UTC (rev 504)
@@ -156,6 +156,7 @@
long delta1 = System.currentTimeMillis() - time;
assertResultList(result, fixtures.refNbFishingVessel());
+ log.debug("Load fishing vessels (without cache) in: " + delta1 + "ms");
// try again, to check cache is enable
time = System.currentTimeMillis();
@@ -163,6 +164,7 @@
assertResultList(result, fixtures.refNbFishingVessel());
long delta2 = System.currentTimeMillis() - time;
+ log.debug("Load fishing vessels (with cache enable) in: " + delta2 + "ms");
//TODO-tc We should not test cache performance like this, depends to much of the computer usage,...
// float reduceFactor = delta2 * 100 / delta1;
1
0
r503 - in trunk/tutti-persistence/src/main/resources: . META-INF/services
by tchemit@users.forge.codelutin.com 28 Feb '13
by tchemit@users.forge.codelutin.com 28 Feb '13
28 Feb '13
Author: tchemit
Date: 2013-02-28 12:59:26 +0100 (Thu, 28 Feb 2013)
New Revision: 503
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/503
Log:
fix query + remove no more use IdAware service file
Removed:
trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware
Modified:
trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
Deleted: trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware
===================================================================
--- trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware 2013-02-28 11:31:03 UTC (rev 502)
+++ trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware 2013-02-28 11:59:26 UTC (rev 503)
@@ -1,20 +0,0 @@
-fr.ifremer.tutti.persistence.entities.data.Attachment
-fr.ifremer.tutti.persistence.entities.data.AccidentalBatch
-fr.ifremer.tutti.persistence.entities.data.BenthosBatch
-fr.ifremer.tutti.persistence.entities.data.FishingOperation
-fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch
-fr.ifremer.tutti.persistence.entities.data.PlanktonBatch
-fr.ifremer.tutti.persistence.entities.data.Program
-fr.ifremer.tutti.persistence.entities.data.Cruise
-fr.ifremer.tutti.persistence.entities.data.SpeciesBatch
-fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency
-fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol
-fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue
-fr.ifremer.tutti.persistence.entities.referential.Country
-fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation
-fr.ifremer.tutti.persistence.entities.referential.Gear
-fr.ifremer.tutti.persistence.entities.referential.Caracteristic
-fr.ifremer.tutti.persistence.entities.referential.Person
-fr.ifremer.tutti.persistence.entities.referential.Species
-fr.ifremer.tutti.persistence.entities.referential.Vessel
-fr.ifremer.tutti.persistence.entities.referential.Zone
\ No newline at end of file
Modified: trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-02-28 11:31:03 UTC (rev 502)
+++ trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-02-28 11:59:26 UTC (rev 503)
@@ -78,7 +78,7 @@
<!-- [DAT-03] Get a detail program -->
<query name="program">
<![CDATA[
- SELECT
+ SELECT
p.code,
p.name,
p.description,
@@ -119,7 +119,10 @@
mp.id AS managerId,
sc.comments AS scientificCruiseComments,
ft.comments AS fishingTripComments,
- (select sm.alphanumericalValue from SurveyMeasurementImpl sm where sm.fishingTrip.id=ft.id and sm.pmfm.id= :pmfmIdSurveyPart) AS surveyPart,
+ (SELECT sm.alphanumericalValue
+ FROM SurveyMeasurementImpl sm
+ WHERE sm.fishingTrip.id=ft.id AND sm.pmfm.id= :pmfmIdSurveyPart
+ ) AS surveyPart
FROM
ScientificCruiseImpl sc
LEFT OUTER JOIN sc.fishingTrips ft
1
0