Merge remote-tracking branch 'upstream/master'

Resolve conflicts.
This commit is contained in:
Vova Perebykivskyi 2016-05-10 15:51:15 +03:00 committed by Dgray16
commit c7b428b61b
12 changed files with 94 additions and 111 deletions

View file

@ -47,22 +47,30 @@ public class AdvanceType extends BaseEntity implements IHumanIdentifiable{
public static AdvanceType create() {
AdvanceType advanceType = new AdvanceType();
advanceType.setNewObject(true);
return advanceType;
}
public static AdvanceType create(String unitName,
BigDecimal defaultMaxValue, boolean updatable,
BigDecimal unitPrecision, boolean active, boolean percentage) {
return create(unitName, defaultMaxValue, updatable, unitPrecision,
active, percentage, false);
BigDecimal defaultMaxValue,
boolean updatable,
BigDecimal unitPrecision,
boolean active,
boolean percentage) {
return create(unitName, defaultMaxValue, updatable, unitPrecision, active, percentage, false);
}
public static AdvanceType create(String unitName,
BigDecimal defaultMaxValue, boolean updatable,
BigDecimal unitPrecision, boolean active, boolean percentage,
boolean qualityForm) {
return create(new AdvanceType(unitName, defaultMaxValue, updatable,
unitPrecision, active, percentage, qualityForm));
BigDecimal defaultMaxValue,
boolean updatable,
BigDecimal unitPrecision,
boolean active,
boolean percentage,
boolean qualityForm) {
return create(
new AdvanceType(unitName, defaultMaxValue, updatable, unitPrecision, active, percentage, qualityForm));
}
private String unitName;

View file

@ -41,21 +41,18 @@ public interface IEntitySequenceDAO extends IGenericDAO<EntitySequence, Long> {
List<EntitySequence> getAll();
List<EntitySequence> findEntitySquencesNotIn(
List<EntitySequence> entitySequences);
List<EntitySequence> findEntitySquencesNotIn(List<EntitySequence> entitySequences);
void remove(EntitySequence entitySequence)
throws InstanceNotFoundException, IllegalArgumentException;
void remove(EntitySequence entitySequence) throws InstanceNotFoundException, IllegalArgumentException;
EntitySequence getActiveEntitySequence(EntityNameEnum entityName)
throws InstanceNotFoundException, NonUniqueResultException;
EntitySequence getActiveEntitySequence(EntityNameEnum entityName) throws InstanceNotFoundException,
NonUniqueResultException;
String getNextEntityCode(EntityNameEnum entityName);
String getNextEntityCodeWithoutTransaction(EntityNameEnum entityName);
boolean existOtherActiveSequenceByEntityNameForNewObject(
EntitySequence entitySequence);
boolean existOtherActiveSequenceByEntityNameForNewObject(EntitySequence entitySequence);
Integer getNumberOfDigitsCode(EntityNameEnum entityName);

View file

@ -49,22 +49,31 @@ import org.libreplan.business.workreports.entities.WorkReportType;
*/
public enum EntityNameEnum {
ORDER("Project", false), CRITERION("Criterion", true), LABEL("Label", true), MACHINE(
"Machine", true), WORKER("Worker", true), UNIT_TYPE(
"Material unit",
true), CALENDAR("Calendar", true), WORK_HOURS_TYPE(
"Hours type", true), MATERIAL_CATEGORY("Material category", true), WORK_REPORT(
"Timesheet", true), WORKREPORTTYPE("Timesheet template", false), CALENDAR_EXCEPTION_TYPE(
"Calendar exception day", true), COST_CATEGORY("Cost category",
true), RESOURCE_CALENDAR("Resource calendar", true), CRITERION_SATISFACTION(
"Criterion satisfaction", true), RESOURCE_COST_CATEGORY_ASSIGNMENT(
"Resource cost category assignment", true), EXPENSE_SHEET("Expense sheet", true), ISSUE_LOG("Issue log", true), RISK_LOG("Risk log", true);
ORDER("Project", false),
CRITERION("Criterion", true),
LABEL("Label", true),
MACHINE("Machine", true),
WORKER("Worker", true),
UNIT_TYPE("Material unit", true),
CALENDAR("Calendar", true),
WORK_HOURS_TYPE("Hours type", true),
MATERIAL_CATEGORY("Material category", true),
WORK_REPORT("Timesheet", true),
WORKREPORTTYPE("Timesheet template", false),
CALENDAR_EXCEPTION_TYPE("Calendar exception day", true),
COST_CATEGORY("Cost category", true),
RESOURCE_CALENDAR("Resource calendar", true),
CRITERION_SATISFACTION("Criterion satisfaction", true),
RESOURCE_COST_CATEGORY_ASSIGNMENT("Resource cost category assignment", true),
EXPENSE_SHEET("Expense sheet", true),
ISSUE_LOG("Issue log", true),
RISK_LOG("Risk log", true);
private String description;
private boolean canContainLowBar;
private EntityNameEnum(String description, boolean canContainLowBar) {
EntityNameEnum(String description, boolean canContainLowBar) {
this.description = description;
this.canContainLowBar = canContainLowBar;
}
@ -80,59 +89,47 @@ public enum EntityNameEnum {
public IIntegrationEntityDAO<? extends IntegrationEntity> getIntegrationEntityDAO() {
switch (this) {
case ORDER:
return (IIntegrationEntityDAO<Order>) Registry.getOrderDAO();
return Registry.getOrderDAO();
case CRITERION:
return (IIntegrationEntityDAO<CriterionType>) Registry
.getCriterionTypeDAO();
return Registry.getCriterionTypeDAO();
case LABEL:
return (IIntegrationEntityDAO<LabelType>) Registry
.getLabelTypeDAO();
return Registry.getLabelTypeDAO();
case MACHINE:
return (IIntegrationEntityDAO<Machine>) Registry.getMachineDAO();
return Registry.getMachineDAO();
case WORKER:
return (IIntegrationEntityDAO<Worker>) Registry.getWorkerDAO();
return Registry.getWorkerDAO();
case UNIT_TYPE:
return (IIntegrationEntityDAO<UnitType>) Registry.getUnitTypeDAO();
return Registry.getUnitTypeDAO();
case CALENDAR:
case RESOURCE_CALENDAR:
return (IIntegrationEntityDAO<CalendarData>) Registry
.getCalendarDataDAO();
return Registry.getCalendarDataDAO();
case WORK_HOURS_TYPE:
return (IIntegrationEntityDAO<TypeOfWorkHours>) Registry
.getTypeOfWorkHoursDAO();
return Registry.getTypeOfWorkHoursDAO();
case MATERIAL_CATEGORY:
return (IIntegrationEntityDAO<MaterialCategory>) Registry
.getMaterialCategoryDAO();
return Registry.getMaterialCategoryDAO();
case WORK_REPORT:
return (IIntegrationEntityDAO<WorkReport>) Registry
.getWorkReportDAO();
return Registry.getWorkReportDAO();
case WORKREPORTTYPE:
return (IIntegrationEntityDAO<WorkReportType>) Registry
.getWorkReportTypeDAO();
return Registry.getWorkReportTypeDAO();
case CALENDAR_EXCEPTION_TYPE:
return (IIntegrationEntityDAO<CalendarExceptionType>) Registry
.getCalendarExceptionTypeDAO();
return Registry.getCalendarExceptionTypeDAO();
case COST_CATEGORY:
return (IIntegrationEntityDAO<CostCategory>) Registry
.getCostCategoryDAO();
return Registry.getCostCategoryDAO();
case CRITERION_SATISFACTION:
return (IIntegrationEntityDAO<CriterionSatisfaction>) Registry
.getCriterionSatisfactionDAO();
return Registry.getCriterionSatisfactionDAO();
case RESOURCE_COST_CATEGORY_ASSIGNMENT:
return (IIntegrationEntityDAO<ResourcesCostCategoryAssignment>) Registry
.getResourcesCostCategoryAssignmentDAO();
return Registry.getResourcesCostCategoryAssignmentDAO();
case EXPENSE_SHEET:
return (IIntegrationEntityDAO<ExpenseSheet>) Registry.getExpenseSheetDAO();
return Registry.getExpenseSheetDAO();
case ISSUE_LOG:
return (IIntegrationEntityDAO<IssueLog>) Registry.getIssueLogDAO();
return Registry.getIssueLogDAO();
case RISK_LOG:
return (IIntegrationEntityDAO<RiskLog>) Registry.getRiskLogDAO();
return Registry.getRiskLogDAO();
default:
throw new RuntimeException("can't handle the code sequence of the "
+ description);
throw new RuntimeException("can't handle the code sequence of the " + description);
}
}

View file

@ -15,8 +15,7 @@
When the DAO does a query, the pending changes are flushed, causing
the validations to be run again.
-->
<property
name="javax.persistence.validation.mode">none</property>
<property name="javax.persistence.validation.mode">none</property>
<property name="jadira.usertype.autoRegisterUserTypes">true</property>
<property name="jadira.usertype.databaseZone">jvm</property>

View file

@ -14,7 +14,7 @@
<!-- Data source. -->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"
p:jndiName="${dataSource.jndiName}" p:resourceRef="true" />
p:jndiName="${dataSource.jndiName}" p:resourceRef="true" />
<!-- Letting Spring do automatically exception translation -->
<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
@ -125,9 +125,7 @@
<context:component-scan base-package="org.libreplan.business" />
<bean id="registry"
class="org.libreplan.business.common.Registry"
factory-method="getInstance" />
<bean id="registry" class="org.libreplan.business.common.Registry" factory-method="getInstance" />
<bean id="CriterionRequirementOrderElementHandler"
class="org.libreplan.business.orders.entities.CriterionRequirementOrderElementHandler"
@ -157,8 +155,6 @@
</property>
</bean>
<bean id="scenarioManager"
class="org.libreplan.business.scenarios.OnlyMainScenarioAwareManager"
scope="singleton"/>
<bean id="scenarioManager" class="org.libreplan.business.scenarios.OnlyMainScenarioAwareManager" scope="singleton"/>
</beans>

View file

@ -12,17 +12,13 @@
</id>
<version name="version" access="property" type="long" />
<property name="unitName" access="field" unique="true"
column="unit_name" />
<property name="defaultMaxValue" access="field" scale="4"
column="default_max_value" />
<property name="unitName" access="field" unique="true" column="unit_name" />
<property name="defaultMaxValue" access="field" scale="4" column="default_max_value" />
<property name="updatable" access="field"/>
<property name="unitPrecision" access="field" scale="4"
column="unit_precision" />
<property name="unitPrecision" access="field" scale="4" column="unit_precision" />
<property name="active" access="field"/>
<property name="percentage" access="field"/>
<property name="qualityForm" access="field"
column="quality_form" />
<property name="qualityForm" access="field" column="quality_form" />
<property name="readOnly" column="read_only" />
</class>
@ -37,14 +33,13 @@
<version name="version" access="property" type="long" />
<property name="reportGlobalAdvance" access="field"
column="report_global_advance" />
<property name="reportGlobalAdvance" access="field" column="report_global_advance" />
<!-- Not indexed -->
<many-to-one name="advanceType" class="AdvanceType" column="advance_type_id"/>
<joined-subclass name="DirectAdvanceAssignment" table="direct_advance_assignment">
<key column="advance_assignment_id"></key>
<key column="advance_assignment_id"/>
<!-- Indexed -->
<many-to-one name="orderElement"
@ -60,7 +55,7 @@
access="field"
sort="org.libreplan.business.advance.entities.AdvanceMeasurementComparator" >
<key column="advance_assignment_id" />
<one-to-many class="org.libreplan.business.advance.entities.AdvanceMeasurement"></one-to-many>
<one-to-many class="org.libreplan.business.advance.entities.AdvanceMeasurement"/>
</set>
<!-- Not indexed -->
@ -75,7 +70,7 @@
</joined-subclass>
<joined-subclass name="IndirectAdvanceAssignment" table="indirect_advance_assignment">
<key column="advance_assignment_id"></key>
<key column="advance_assignment_id"/>
<!-- Indexed -->
<many-to-one name="orderElement"
@ -107,10 +102,8 @@
<property name="date" access="field"/>
<property name="value" scale="2" access="field" />
<many-to-one name="advanceAssignment" class="AdvanceAssignment"
column="advance_assignment_id" access="field" />
<property name="communicationDate" access="field"
column="communication_date" />
<many-to-one name="advanceAssignment" class="AdvanceAssignment" column="advance_assignment_id" access="field" />
<property name="communicationDate" access="field" column="communication_date" />
<!-- Not indexed -->
<set name="nonCalculatedConsolidatedValues" access="field" cascade="none" inverse="true" batch-size="10">
@ -138,8 +131,7 @@
column="order_element_template_id"
index="idx_advance_assigment_template_on_template"/>
<property name="reportGlobalAdvance" access="field"
column="report_global_advance" />
<property name="reportGlobalAdvance" access="field" column="report_global_advance" />
<property name="maxValue" access="field" scale="2" column="max_value" />
</class>

View file

@ -45,9 +45,7 @@
<property name="deadline" access="field"/>
<property name="communicationType" access="field" column="communication_type">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">
org.libreplan.business.externalcompanies.entities.CommunicationType
</param>
<param name="enumClass">org.libreplan.business.externalcompanies.entities.CommunicationType</param>
</type>
</property>
<property name="communicationDate" access="field" column="communication_date" />

View file

@ -47,9 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
BUSINESS_SPRING_CONFIG_FILE,
BUSINESS_SPRING_CONFIG_TEST_FILE })
@ContextConfiguration(locations = {BUSINESS_SPRING_CONFIG_FILE, BUSINESS_SPRING_CONFIG_TEST_FILE })
public class EntitySequenceTest {
@Autowired

View file

@ -44,8 +44,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Susana Montes Pedreira <smontes@wirelessgalicia.com>
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE,
BUSINESS_SPRING_CONFIG_TEST_FILE })
@ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE, BUSINESS_SPRING_CONFIG_TEST_FILE })
public class WorkReportTypeTest extends AbstractWorkReportTest {
@Autowired

View file

@ -9,11 +9,9 @@
<property name="hibernate.use_sql_comments">true</property>
<property name="hibernate.hbm2ddl.auto">create-drop</property>
<property
name="javax.persistence.validation.mode">none</property>
<property name="javax.persistence.validation.mode">none</property>
<property
name="javax.persistence.validation.mode">none</property>
<property name="javax.persistence.validation.mode">none</property>
<property name="jadira.usertype.autoRegisterUserTypes">true</property>
<property name="jadira.usertype.databaseZone">jvm</property>

View file

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd">
<bean id="dataSourceReal"
class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close"
p:driverClass="${jdbcDriver.className}" p:jdbcUrl="${testDataSource.url}"
p:username="${testDataSource.user}" p:password="${testDataSource.password}"
p:driverClass="${jdbcDriver.className}"
p:jdbcUrl="${testDataSource.url}"
p:username="${testDataSource.user}"
p:password="${testDataSource.password}"
p:maxConnectionsPerPartition="10"
p:minConnectionsPerPartition="4"
p:partitionCount="3"/>

13
pom.xml
View file

@ -181,12 +181,12 @@
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>4.7.0</version>
<version>6.2.2</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-fonts</artifactId>
<version>4.0.0</version>
<version>6.0.0</version>
</dependency>
<!-- GPL Jasperreport Component for ZK -->
@ -231,6 +231,7 @@
</dependency>
<!-- Hibernate -->
<!-- TODO Hibernate 5.1.0.FINAL for Spring 4.2+ -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
@ -416,7 +417,7 @@
<dependency>
<groupId>org.beanshell</groupId>
<artifactId>bsh</artifactId>
<version>2.0b4</version>
<version>2.0b5</version>
<scope>runtime</scope>
</dependency>
@ -424,7 +425,7 @@
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
<version>1.3.1</version>
<scope>runtime</scope>
</dependency>
@ -581,12 +582,12 @@
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.7.3</version>
<version>2.7.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>2.7.3</version>
<version>2.7.4</version>
</dependency>
<!-- ZK Timeplot -->