Commit 5458e6c8 authored by Noel Alonso's avatar Noel Alonso
Browse files

Merge branch 'dev' into 'master'

Actualiza imagen de compilación

See merge request redmic-project/server/library/db!2
parents ece1aa26 bf90d27f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ stages:

maven-build:
  stage: build
  image: redmic/maven-gitlab
  image: registry.gitlab.com/redmic-project/docker/maven
  variables:
    MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
  only:
+83 −12
Original line number Diff line number Diff line
@@ -3,19 +3,42 @@
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<parent>
		<groupId>es.redmic.lib</groupId>
		<artifactId>libs</artifactId>
		<version>0.6.0</version>
		<groupId>org.springframework.boot</groupId>
   		<artifactId>spring-boot-starter-parent</artifactId>
    	<version>2.0.0.RELEASE</version>
		<relativePath/>
	</parent>

	<modelVersion>4.0.0</modelVersion>
	<groupId>es.redmic.lib</groupId>
	<artifactId>db</artifactId>
	<packaging>jar</packaging>
	<version>0.6.0</version>
	<name>DB</name>
	<description>Services, repository and models in DB</description>

	<properties>
		<checkstyle.config.location>src/main/resources/checkstyle.xml</checkstyle.config.location>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<java.version>1.8</java.version>

		<!-- REDMIC -->
		<redmic.db-commons.version>0.6.0</redmic.db-commons.version>
		<redmic.models.version>0.6.0</redmic.models.version>
		<redmic.exceptions.version>0.6.0</redmic.exceptions.version>
		
		<!-- OTHER -->
		<powermock.version>1.7.3</powermock.version>
		
		<!-- Plugins -->
		<jacoco.version>0.8.1</jacoco.version>
		<com.mysema.maven.version>1.1.3</com.mysema.maven.version>
		<com.mysema.querydsl.version>4.1.4</com.mysema.querydsl.version>
		
		<!-- Environment variables -->
		<env.MAVEN_REPO_URL>https://artifactory.redmic.net/artifactory</env.MAVEN_REPO_URL>
	</properties>

	<dependencies>
@@ -24,20 +47,20 @@
		<dependency>
			<groupId>es.redmic.lib</groupId>
			<artifactId>db-commons</artifactId>
			<version>${redmic.version}</version>
			<version>${redmic.db-commons.version}</version>
		</dependency>

		<dependency>
			<groupId>es.redmic.lib</groupId>
			<artifactId>models</artifactId>
			<version>${redmic.version}</version>
			<version>${redmic.models.version}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>es.redmic.lib</groupId>
			<artifactId>exceptions</artifactId>
			<version>${redmic.version}</version>
			<version>${redmic.exceptions.version}</version>
			<scope>provided</scope>
		</dependency>

@@ -60,22 +83,50 @@
			<artifactId>hibernate-spatial</artifactId>
		</dependency>
		
		<!-- Test -->
		<!-- Logs -->
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<scope>provided</scope>
		</dependency>

		<!-- Test -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.powermock</groupId>
			<artifactId>powermock-api-easymock</artifactId>
			<version>${powermock.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<distributionManagement>
		<repository>
			<id>central</id>
			<name>redmic-releases</name>
			<url>${env.MAVEN_REPO_URL}/libs-release-local</url>
		</repository>
		<snapshotRepository>
			<id>snapshots</id>
			<name>redmic-snapshots</name>
			<url>${env.MAVEN_REPO_URL}/libs-snapshot-local</url>
			<uniqueVersion>false</uniqueVersion>
		</snapshotRepository>
	</distributionManagement>
	<build>
		<plugins>
			<plugin>
				<groupId>com.mysema.maven</groupId>
				<artifactId>apt-maven-plugin</artifactId>
				<version>${com.mysema.maven}</version>
				<version>${com.mysema.maven.version}</version>
				<executions>
					<execution>
						<goals>
@@ -92,10 +143,30 @@
					<dependency>
						<groupId>com.querydsl</groupId>
						<artifactId>querydsl-apt</artifactId>
						<version>${com.mysema.querydsl}</version>
						<version>${com.mysema.querydsl.version}</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco.version}</version>
				<executions>
					<execution>
						<id>pre-unit-test</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>post-unit-test</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
+7 −0
Original line number Diff line number Diff line
package es.redmic.db.administrative.taxonomy.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import es.redmic.databaselib.common.repository.BaseRepository;
import es.redmic.db.administrative.taxonomy.model.Family;

public interface FamilyRepository extends BaseRepository<Family, Long> {
	
	@Query(value = "SELECT t FROM Family t WHERE t.validas IS NOT NULL")
	Page<Family> findFamilyWithValidAs(Pageable pageable);

}
+7 −0
Original line number Diff line number Diff line
package es.redmic.db.administrative.taxonomy.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import es.redmic.databaselib.common.repository.BaseRepository;
import es.redmic.db.administrative.taxonomy.model.Orderr;

public interface OrderRepository extends BaseRepository<Orderr, Long> {
	
	@Query(value = "SELECT t FROM Orderr t WHERE t.validas IS NOT NULL")
	Page<Orderr> findOrderWithValidAs(Pageable pageable);

}
+5 −5
Original line number Diff line number Diff line
@@ -7,11 +7,11 @@ import es.redmic.databaselib.common.repository.BaseRepository;
import es.redmic.db.geodata.properties.fixedsurvey.model.FixedMeasurement;
import es.redmic.db.maintenance.parameter.model.DataDefinition;


public interface FixedMeasurementRepository extends BaseRepository<FixedMeasurement, Long> {

	@Query("select s from FixedMeasurement s where s.fixedSurvey.id = :id and s.z = :z")
	FixedMeasurement findByZAndSurveyStation(@Param("z") double z, @Param("id") Long surveyStationId);
	@Query("select s from FixedMeasurement s where s.fixedSurvey.id = :id and s.z = :z and s.dataDefinition.id = :dataDefinitionId")
	FixedMeasurement findByZAndSurveyStation(@Param("z") double z, @Param("id") Long surveyStationId,
			@Param("dataDefinitionId") Long dataDefinitionId);

	@Query("select s from FixedMeasurement s where s.dataDefinition.id = :id")
	FixedMeasurement findByDataDefinitionId(@Param("id") Long dataDefinitionId);
Loading