Commit 28279a65 authored by Patrik Dufresne's avatar Patrik Dufresne

Merge branch 'develop/patrik/upgrade-packages' into 'master'

Develop/patrik/upgrade packages

See merge request !13
parents 5866daab fa1fc880
Pipeline #644 passed with stages
in 11 minutes and 17 seconds
......@@ -62,7 +62,7 @@
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.swt</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.swt.win32.win32.x86</artifactId>
</artifactItem>
</artifactItems>
......@@ -78,7 +78,7 @@
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.swt</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.swt.win32.win32.x86_64</artifactId>
</artifactItem>
</artifactItems>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2019 Patrik Dufresne Service Logiciel <info@patrikdufresne.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
......
====
Copyright (C) 2019 Patrik Dufresne Service Logiciel <info@patrikdufresne.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
====
nsisFirewall -- Small NSIS plugin for simple tasks with Windows Firewall
Web site: http://wiz0u.free.fr/prog/nsisFirewall
......
====
Copyright (C) 2019 Patrik Dufresne Service Logiciel <info@patrikdufresne.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
====
nsisFirewall 1.2 -- Small NSIS plugin for simple tasks with Windows build-in Firewall
Web site: http://wiz0u.free.fr/prog/nsisFirewall
---------------------------------------------------------
......
/**
* Copyright (C) 2019 Patrik Dufresne Service Logiciel <info@patrikdufresne.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _EXDLL_H_
#define _EXDLL_H_
......
/**
* Copyright (C) 2019 Patrik Dufresne Service Logiciel <info@patrikdufresne.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*
nsisFirewall -- Small NSIS plugin for simple tasks with Windows Firewall
Web site: http://wiz0u.free.fr/prog/nsisFirewall
......
<!--
Copyright (C) 2019 Patrik Dufresne Service Logiciel <info@patrikdufresne.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
......
......@@ -8,86 +8,24 @@
<version>${revision}</version>
</parent>
<artifactId>planimod</artifactId>
<profiles>
<profile>
<id>linux_x86_64</id>
<activation>
<os>
<name>linux</name>
<arch>amd64</arch>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>win_x86</id>
<activation>
<os>
<family>windows</family>
<arch>amd64</arch>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.win32.win32.x86_64</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.eclipse.jface</groupId>
<artifactId>org.eclipse.jface</artifactId>
<version>3.8.0.v20120521-2329</version>
</dependency>
<dependency>
<groupId>org.eclipse.core.databinding</groupId>
<artifactId>org.eclipse.core.databinding.property</artifactId>
<version>1.4.0.I20110222-0800</version>
</dependency>
<dependency>
<groupId>org.eclipse.ui</groupId>
<artifactId>org.eclipse.ui.forms</artifactId>
<version>3.5.200.v20120521-2329</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.patrikdufresne.managers</groupId>
<artifactId>com.patrikdufresne.managers.jface</artifactId>
<version>1.21</version>
</dependency>
<dependency>
<groupId>com.patrikdufresne.managers</groupId>
<artifactId>com.patrikdufresne.managers.databinding</artifactId>
<version>1.21</version>
<groupId>com.patrikdufresne</groupId>
<artifactId>managers-databinding</artifactId>
</dependency>
<dependency>
<groupId>com.patrikdufresne.printing</groupId>
<artifactId>com.patrikdufresne.printing</artifactId>
<version>0.8</version>
<groupId>com.patrikdufresne</groupId>
<artifactId>printing</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
......@@ -136,38 +74,6 @@
</archive>
</configuration>
</plugin>
<!-- Formatting -->
<plugin>
<groupId>com.googlecode.maven-java-formatter-plugin</groupId>
<artifactId>maven-java-formatter-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
<configuration>
<configFile>${project.basedir}/../formatter.xml</configFile>
<lineEnding>CRLF</lineEnding>
</configuration>
</plugin>
<!-- Add license header -->
<plugin>
<groupId>com.mycila.maven-license-plugin</groupId>
<artifactId>maven-license-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
<configuration>
<header>license-header.txt</header>
</configuration>
</plugin>
<!-- Localized -->
<!-- This plugin required to install "gettext". -->
<!-- sudo apt-get install gettext -->
......@@ -191,15 +97,6 @@
<outputFormat>properties</outputFormat>
</configuration>
</plugin>
<!-- Need the following to overcome a bug with surefire and java8 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx512m</argLine>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -42,11 +42,8 @@ public class ApplicationSettingManager extends AbstractManager<ApplicationSettin
@Override
public String run() throws ManagerException {
ApplicationSetting setting = (ApplicationSetting) ManagerContext
.getDefaultSession()
.createCriteria(objectClass())
.add(Restrictions.eq(ApplicationSetting.NAME, name))
.uniqueResult();
ApplicationSetting setting = (ApplicationSetting) ManagerContext.getDefaultSession().createCriteria(objectClass()).add(
Restrictions.eq(ApplicationSetting.NAME, name)).uniqueResult();
if (setting == null) {
return null;
}
......@@ -103,11 +100,8 @@ public class ApplicationSettingManager extends AbstractManager<ApplicationSettin
@Override
public void run() throws ManagerException {
ApplicationSetting setting = (ApplicationSetting) ManagerContext
.getDefaultSession()
.createCriteria(objectClass())
.add(Restrictions.eq(ApplicationSetting.NAME, name))
.uniqueResult();
ApplicationSetting setting = (ApplicationSetting) ManagerContext.getDefaultSession().createCriteria(objectClass()).add(
Restrictions.eq(ApplicationSetting.NAME, name)).uniqueResult();
if (setting == null) {
setting = new ApplicationSetting();
setting.setName(name);
......
......@@ -72,11 +72,8 @@ public class EmployeePreferenceManager extends AbstractManager<EmployeePreferenc
return getManagers().query(new Query<EmployeePreference>() {
@Override
public EmployeePreference run() throws ManagerException {
return (EmployeePreference) ManagerContext
.getDefaultSession()
.createCriteria(objectClass())
.add(Restrictions.eq(EmployeePreference.EMPLOYEE, employee))
.uniqueResult();
return (EmployeePreference) ManagerContext.getDefaultSession().createCriteria(objectClass()).add(
Restrictions.eq(EmployeePreference.EMPLOYEE, employee)).uniqueResult();
}
});
......@@ -96,11 +93,8 @@ public class EmployeePreferenceManager extends AbstractManager<EmployeePreferenc
public List<EmployeePreference> run() throws ManagerException {
// FIXME This function return multiple EmployeePreference for
// the same Employee.
List<EmployeePreference> preferences = ManagerContext
.getDefaultSession()
.createCriteria(objectClass())
.add(Restrictions.in(EmployeePreference.EMPLOYEE, employees))
.list();
List<EmployeePreference> preferences = ManagerContext.getDefaultSession().createCriteria(objectClass()).add(
Restrictions.in(EmployeePreference.EMPLOYEE, employees)).list();
// Quick fix
return new ArrayList<EmployeePreference>(new HashSet<EmployeePreference>(preferences));
}
......@@ -119,12 +113,8 @@ public class EmployeePreferenceManager extends AbstractManager<EmployeePreferenc
public List<EmployeePreference> run() throws ManagerException {
// FIXME This function return multiple EmployeePreference for
// the same Employee.
List<EmployeePreference> preferences = ManagerContext
.getDefaultSession()
.createCriteria(EmployeePreference.class)
.createCriteria(EmployeePreference.EMPLOYEE)
.add(Restrictions.isNull(ArchivableObject.ARCHIVED_DATE))
.list();
List<EmployeePreference> preferences = ManagerContext.getDefaultSession().createCriteria(EmployeePreference.class).createCriteria(
EmployeePreference.EMPLOYEE).add(Restrictions.isNull(ArchivableObject.ARCHIVED_DATE)).list();
// Quick fix
return new ArrayList<EmployeePreference>(new HashSet<EmployeePreference>(preferences));
}
......
......@@ -49,11 +49,10 @@ public class NonAvailabilityManager extends AbstractManager<NonAvailability> {
// (start < event.end < end)
// OU
// (event.start < start ET event.end > end)
return Restrictions.or(
Restrictions.or(
Restrictions.between(AbstractCalendarEvent.START_DATE, start, end),
Restrictions.between(AbstractCalendarEvent.END_DATE, start, end)),
Restrictions.and(Restrictions.lt(AbstractCalendarEvent.START_DATE, start), Restrictions.gt(AbstractCalendarEvent.END_DATE, end)));
return Restrictions.or(Restrictions.or(Restrictions.between(AbstractCalendarEvent.START_DATE, start, end), Restrictions.between(
AbstractCalendarEvent.END_DATE,
start,
end)), Restrictions.and(Restrictions.lt(AbstractCalendarEvent.START_DATE, start), Restrictions.gt(AbstractCalendarEvent.END_DATE, end)));
}
public NonAvailabilityManager(PlanimodManagers managers) {
......@@ -81,13 +80,8 @@ public class NonAvailabilityManager extends AbstractManager<NonAvailability> {
return getManagers().query(new Query<List<NonAvailability>>() {
@Override
public List<NonAvailability> run() throws ManagerException {
return ManagerContext
.getDefaultSession()
.createCriteria(NonAvailability.class)
.add(startEndCriterion(start, end))
.createCriteria(NonAvailability.EMPLOYEE)
.add(Restrictions.isNull(ArchivableObject.ARCHIVED_DATE))
.list();
return ManagerContext.getDefaultSession().createCriteria(NonAvailability.class).add(startEndCriterion(start, end)).createCriteria(
NonAvailability.EMPLOYEE).add(Restrictions.isNull(ArchivableObject.ARCHIVED_DATE)).list();
}
});
}
......@@ -108,14 +102,8 @@ public class NonAvailabilityManager extends AbstractManager<NonAvailability> {
return getManagers().query(new Query<List<NonAvailability>>() {
@Override
public List<NonAvailability> run() throws ManagerException {
return ManagerContext
.getDefaultSession()
.createCriteria(NonAvailability.class)
.add(Restrictions.eq(NonAvailability.VISIBLE, visibility))
.add(startEndCriterion(start, end))
.createCriteria(NonAvailability.EMPLOYEE)
.add(Restrictions.isNull(ArchivableObject.ARCHIVED_DATE))
.list();
return ManagerContext.getDefaultSession().createCriteria(NonAvailability.class).add(Restrictions.eq(NonAvailability.VISIBLE, visibility)).add(
startEndCriterion(start, end)).createCriteria(NonAvailability.EMPLOYEE).add(Restrictions.isNull(ArchivableObject.ARCHIVED_DATE)).list();
}
});
}
......@@ -124,12 +112,8 @@ public class NonAvailabilityManager extends AbstractManager<NonAvailability> {
return getManagers().query(new Query<List<NonAvailability>>() {
@Override
public List<NonAvailability> run() throws ManagerException {
return ManagerContext
.getDefaultSession()
.createCriteria(objectClass())
.add(startEndCriterion(start, end))
.add(Restrictions.in(NonAvailability.EMPLOYEE, employees))
.list();
return ManagerContext.getDefaultSession().createCriteria(objectClass()).add(startEndCriterion(start, end)).add(
Restrictions.in(NonAvailability.EMPLOYEE, employees)).list();
}
});
}
......
......@@ -28,7 +28,7 @@ import com.patrikdufresne.managers.ArchivableObject;
* The Product class represent one product that may be schedule.
*/
@Entity
@NamedQueries({
@NamedQueries( {
@NamedQuery(name = "listProductTableByShifts", query = "SELECT S, P, SUM(PP.number), S.team "
+ "FROM Product as P, Shift as S, ProductionEvent as PE, ProductPosition as PP "
+ "WHERE PP.product = P "
......
......@@ -33,7 +33,7 @@ import com.patrikdufresne.managers.ManagedObject;
*
*/
@Entity
@NamedQueries({ @NamedQuery(name = "listProductionEventTableByShifts", query = "SELECT PE, SUM(PP.number), PE.product, PE.shift, S.team "
@NamedQueries( { @NamedQuery(name = "listProductionEventTableByShifts", query = "SELECT PE, SUM(PP.number), PE.product, PE.shift, S.team "
+ "FROM ProductPosition as PP, ProductionEvent as PE JOIN PE.product JOIN PE.shift as S JOIN S.team "
+ "WHERE PP.product = PE.product "
+ "AND PE.shift in (:shifts) "
......
......@@ -47,11 +47,10 @@ public class ProductionEventManager extends AbstractManager<ProductionEvent> {
// (start < event.end < end)
// OU
// (event.start < start ET event.end > end)
return Restrictions.or(
Restrictions.or(
Restrictions.between(AbstractCalendarEvent.START_DATE, start, end),
Restrictions.between(AbstractCalendarEvent.END_DATE, start, end)),
Restrictions.and(Restrictions.lt(AbstractCalendarEvent.START_DATE, start), Restrictions.gt(AbstractCalendarEvent.END_DATE, end)));
return Restrictions.or(Restrictions.or(Restrictions.between(AbstractCalendarEvent.START_DATE, start, end), Restrictions.between(
AbstractCalendarEvent.END_DATE,
start,
end)), Restrictions.and(Restrictions.lt(AbstractCalendarEvent.START_DATE, start), Restrictions.gt(AbstractCalendarEvent.END_DATE, end)));
}
public ProductionEventManager(PlanimodManagers managers) {
......@@ -158,12 +157,8 @@ public class ProductionEventManager extends AbstractManager<ProductionEvent> {
return getManagers().query(new Query<List<ProductionEvent>>() {
@Override
public List<ProductionEvent> run() throws ManagerException {
return ManagerContext
.getDefaultSession()
.createCriteria(ProductionEvent.class)
.createCriteria(ProductionEvent.SHIFT)
.add(startEndCriterion(start, end))
.list();
return ManagerContext.getDefaultSession().createCriteria(ProductionEvent.class).createCriteria(ProductionEvent.SHIFT).add(
startEndCriterion(start, end)).list();
}
});
}
......
......@@ -32,7 +32,7 @@ import com.patrikdufresne.managers.ManagedObject;
*
*/
@Entity
@NamedQueries({ @NamedQuery(name = "getQualificationTableByPositions", query = "SELECT E, Po, Se "
@NamedQueries( { @NamedQuery(name = "getQualificationTableByPositions", query = "SELECT E, Po, Se "
+ "FROM Qualification Q JOIN Q.employee as E JOIN Q.position as Po JOIN Po.section as Se "
+ "WHERE Q.position in :positions AND E.archivedDate is null") })
public class Qualification extends ManagedObject {
......
......@@ -127,11 +127,8 @@ public class ShiftManager extends AbstractManager<Shift> {
return getManagers().query(new Query<List<? extends AbstractCalendarEvent>>() {
@Override
public List<? extends AbstractCalendarEvent> run() throws ManagerException {
return ManagerContext
.getDefaultSession()
.createCriteria(objectClass())
.add(Restrictions.and(Restrictions.eq(Shift.TEAM, team), startEndCriterion(start, end)))
.list();
return ManagerContext.getDefaultSession().createCriteria(objectClass()).add(
Restrictions.and(Restrictions.eq(Shift.TEAM, team), startEndCriterion(start, end))).list();
}
});
}
......@@ -196,11 +193,10 @@ public class ShiftManager extends AbstractManager<Shift> {
// (start < event.end < end)
// OU
// (event.start < start ET event.end > end)
return Restrictions.or(
Restrictions.or(
Restrictions.between(AbstractCalendarEvent.START_DATE, start, end),
Restrictions.between(AbstractCalendarEvent.END_DATE, start, end)),
Restrictions.and(Restrictions.lt(AbstractCalendarEvent.START_DATE, start), Restrictions.gt(AbstractCalendarEvent.END_DATE, end)));
return Restrictions.or(Restrictions.or(Restrictions.between(AbstractCalendarEvent.START_DATE, start, end), Restrictions.between(
AbstractCalendarEvent.END_DATE,
start,
end)), Restrictions.and(Restrictions.lt(AbstractCalendarEvent.START_DATE, start), Restrictions.gt(AbstractCalendarEvent.END_DATE, end)));
}
/**
......
......@@ -31,21 +31,19 @@ import org.hibernate.annotations.NamedQuery;
*
*/
@Entity
@NamedQueries({
@NamedQuery(
name = "listQualificationAndAvaibilityTable",
query = "SELECT E, Ta, Po, Se, PE, Pr, S, Te "
+ "FROM Employee E, Task Ta JOIN Ta.position as Po JOIN Po.section as Se JOIN Ta.productionEvent as PE JOIN PE.product as Pr JOIN PE.shift as S JOIN S.team as Te, Qualification Q "
+ "WHERE E.id = Q.employee "
+ "AND Q.position=Ta.position "
+ "AND Ta.startDate >= :start "
+ "AND Ta.endDate <= :end "
+ "AND not exists ( "
+ "FROM NonAvailability as NA "
+ "WHERE NA.employee=E "
+ "AND NA.startDate <= Ta.startDate "
+ "AND NA.endDate >= Ta.endDate "
+ ")"),
@NamedQueries( {
@NamedQuery(name = "listQualificationAndAvaibilityTable", query = "SELECT E, Ta, Po, Se, PE, Pr, S, Te "
+ "FROM Employee E, Task Ta JOIN Ta.position as Po JOIN Po.section as Se JOIN Ta.productionEvent as PE JOIN PE.product as Pr JOIN PE.shift as S JOIN S.team as Te, Qualification Q "
+ "WHERE E.id = Q.employee "
+ "AND Q.position=Ta.position "
+ "AND Ta.startDate >= :start "
+ "AND Ta.endDate <= :end "
+ "AND not exists ( "
+ "FROM NonAvailability as NA "
+ "WHERE NA.employee=E "
+ "AND NA.startDate <= Ta.startDate "
+ "AND NA.endDate >= Ta.endDate "
+ ")"),
@NamedQuery(name = "listQualifiedAndAvailableEmployees", query = "SELECT DISTINCT E "
+ "FROM Employee E, Qualification Q, ProductPosition PP, ProductionEvent PE "
+ "JOIN PE.shift as S "
......
......@@ -62,11 +62,10 @@ public class TaskManager extends AbstractManager<Task> {
// (start < event.end < end)
// OU
// (event.start < start ET event.end > end)
return Restrictions.or(
Restrictions.or(
Restrictions.between(AbstractCalendarEvent.START_DATE, start, end),
Restrictions.between(AbstractCalendarEvent.END_DATE, start, end)),
Restrictions.and(Restrictions.lt(AbstractCalendarEvent.START_DATE, start), Restrictions.gt(AbstractCalendarEvent.END_DATE, end)));
return Restrictions.or(Restrictions.or(Restrictions.between(AbstractCalendarEvent.START_DATE, start, end), Restrictions.between(
AbstractCalendarEvent.END_DATE,
start,
end)), Restrictions.and(Restrictions.lt(AbstractCalendarEvent.START_DATE, start), Restrictions.gt(AbstractCalendarEvent.END_DATE, end)));
}
public TaskManager(PlanimodManagers managers) {
......@@ -175,12 +174,8 @@ public class TaskManager extends AbstractManager<Task> {
return getManagers().query(new Query<List<Task>>() {
@Override
public List<Task> run() throws ManagerException {
return ManagerContext
.getDefaultSession()
.createCriteria(Task.class)
.add(startEndCriterion(start, end))
.add(Restrictions.eq(Task.EMPLOYEE, employee))
.list();
return ManagerContext.getDefaultSession().createCriteria(Task.class).add(startEndCriterion(start, end)).add(
Restrictions.eq(Task.EMPLOYEE, employee)).list();
}
});
}
......@@ -213,11 +208,8 @@ public class TaskManager extends AbstractManager<Task> {
// FIXME the list of events should be used to reduce the
// size of the table Query database
DetachedCriteria subSelectProducts = DetachedCriteria.forClass(ProductionEvent.class).setProjection(Property.forName(ProductionEvent.PRODUCT));
List<ProductPosition> productPositions = ManagerContext
.getDefaultSession()
.createCriteria(ProductPosition.class)
.add(Property.forName(ProductPosition.PRODUCT).in(subSelectProducts))
.list();
List<ProductPosition> productPositions = ManagerContext.getDefaultSession().createCriteria(ProductPosition.class).add(
Property.forName(ProductPosition.PRODUCT).in(subSelectProducts)).list();
// Create the table.
BidiMultiMap<Product, ProductPosition> table = new BidiMultiHashMap<Product, ProductPosition>();
......
......@@ -42,33 +42,30 @@ public class EmployeeComparators {
// TODO This comparator should be removed
public static Comparator<Employee> bySeniority() {
ComparatorChain chain = new ComparatorChain();
chain.addComparator(ComparatorUtils.nullHighComparator(ComparatorUtils.transformedComparator(
ComparatorUtils.nullHighComparator(ComparatorUtils.naturalComparator()),
new Transformer() {
chain.addComparator(ComparatorUtils.nullHighComparator(ComparatorUtils.transformedComparator(ComparatorUtils.nullHighComparator(ComparatorUtils
.naturalComparator()), new Transformer() {