Initial commit

parents
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
plugins {
id 'org.springframework.boot' version '2.7.4'
id 'io.spring.dependency-management' version '1.0.14.RELEASE'
id 'java'
}
group = 'ec.edu.espe.movilidad'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.lowagie:itext:2.1.7'
implementation 'net.sf.jasperreports:jasperreports:6.9.0'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.oracle.database.jdbc:ojdbc8'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
tasks.named('test') {
useJUnitPlatform()
}
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
rootProject.name = 'MovilidadWS'
package ec.edu.espe.movilidad.MovilidadWS.Constant;
public class GlobalConstants {
public static final String V1_API_VERSION = "/api/v1.0";
}
package ec.edu.espe.movilidad.MovilidadWS;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MovilidadWsApplication {
public static void main(String[] args) {
SpringApplication.run(MovilidadWsApplication.class, args);
}
}
package ec.edu.espe.movilidad.MovilidadWS.controller;
import ec.edu.espe.movilidad.MovilidadWS.model.ModelExample;
import ec.edu.espe.movilidad.MovilidadWS.service.IServiceExample;
import ec.edu.espe.movilidad.MovilidadWS.service.ReportService;
import net.sf.jasperreports.engine.JRException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.io.FileNotFoundException;
import java.util.List;
import static ec.edu.espe.movilidad.MovilidadWS.Constant.GlobalConstants.V1_API_VERSION;
@RestController
@CrossOrigin(origins = "*")
@RequestMapping(V1_API_VERSION+"/example")
public class ExampleController {
@Autowired
private IServiceExample serviceExample;
@Autowired
private ReportService service;
@GetMapping("/exampleFindId/{id}")
public ResponseEntity<ModelExample> ListarPorID(@PathVariable Long id) {
return new ResponseEntity<>(serviceExample.ListarPorID(id), HttpStatus.OK);
}
@GetMapping("/report/{format}")
public String generateReport(@PathVariable String format) throws JRException, FileNotFoundException {
return service.exportReport(format);
}
@GetMapping("/getAll")
public ResponseEntity<List<ModelExample>> ListarRegistros() {
return new ResponseEntity<>(serviceExample.ListarRegistros(), HttpStatus.OK);
}
@PostMapping("/guardar")
public ResponseEntity<ModelExample> guardar(@RequestBody ModelExample modelExample) {
return new ResponseEntity<>(serviceExample.guardar(modelExample), HttpStatus.OK);
}
@PutMapping("/editar/{id}")
public ResponseEntity<ModelExample> editar(@PathVariable Long id, @RequestBody ModelExample modelExample) {
return new ResponseEntity<>(serviceExample.editar(id, modelExample), HttpStatus.OK);
}
@DeleteMapping("/eliminar/{id}")
public ResponseEntity<Void> eliminar(@PathVariable Long id) {
serviceExample.eliminar(id);
return ResponseEntity.ok().build();
}
}
package ec.edu.espe.movilidad.MovilidadWS.dao;
import ec.edu.espe.movilidad.MovilidadWS.model.ModelExample;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import java.util.List;
import java.util.Optional;
public interface DaoExample extends CrudRepository<ModelExample, Long> {
//@Query(value = "SELECT u FROM ModelExample u WHERE u.state = 1 and u.id=?1")
//public Optional<ModelExample> findByIdEnable(Long id);
//@Query(value = "DELETE FROM ModelExample u WHERE u.id = :id")
}
\ No newline at end of file
package ec.edu.espe.movilidad.MovilidadWS.dto;
import lombok.Data;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import java.util.Date;
@Data
public class DtoExample {
private Long id;
private String nombre;
private Boolean estado;
private Date fechaCreacion;
private String UsuarioCreacion;
private Date fechaModificacion;
private String UsuarioModificacion;
}
package ec.edu.espe.movilidad.MovilidadWS.excepciones;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.NOT_FOUND) //cuando no se encuentre un registro
public class ControlExcepciones extends RuntimeException{
private static final long serialVersionID = 1L;
//excepciones personalizadas
public ControlExcepciones(String mensaje) {
super(mensaje);
}
}
package ec.edu.espe.movilidad.MovilidadWS.model;
public class FileModel {
private String name;
private String url;
public FileModel(String name, String url) {
this.name = name;
this.url = url;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
package ec.edu.espe.movilidad.MovilidadWS.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.*;
import java.util.Date;
@Data
@Entity
@Table(name = "UZITAREA")
public class ModelExample {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "UZITAREA_CODE")
private Long id;
@Column(name = "UZITAREA_NAME", nullable = false)
private String name;
@Column(name = "UZITAREA_STATE", nullable = false)
private Boolean state;
@Column(name = "UZITAREA_FECHA_CREA")
@JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING, timezone = JsonFormat.DEFAULT_TIMEZONE)
@Temporal(TemporalType.DATE)
private Date creationDateA;
@Column(name = "UZITAREA_USUA_CREA")
private String creationUser;
@Column(name = "UZITAREA_FECHA_MODIF")
@JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING, timezone = JsonFormat.DEFAULT_TIMEZONE)
@Temporal(TemporalType.DATE)
private Date modificationDate;
@Column(name = "UZITAREA_USUA_MODIF")
private String modificationUser;
}
package ec.edu.espe.movilidad.MovilidadWS.service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.nio.file.Path;
import java.util.stream.Stream;
public interface FileService {
public void init(); //método para guardar el archivo
public void save(MultipartFile file); //MultipartFile resive varios archivos
public Resource load(String filename);
public void deleteAll();
public Stream<Path> loadAll();
public String deleteFile(String filename);
}
package ec.edu.espe.movilidad.MovilidadWS.service;
import org.springframework.core.io.UrlResource;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.stream.Stream;
@Service
public class FileServiceImpl implements FileService{
private final Path root = Paths.get("uploads");
@Override
public void init() {
try {
Files.createDirectory(root);
} catch (IOException e) {
throw new RuntimeException("No se puede iniciar el storage");
}
}
@Override
public void save(MultipartFile file) {
try {
Files.copy(file.getInputStream(), this.root.resolve(file.getOriginalFilename()));
} catch (IOException e) {
throw new RuntimeException("No se pudo guardar el archivo");
}
}
@Override
public Resource load(String filename) {
return null;
}
@Override
public void deleteAll() {
}
@Override
public Stream<Path> loadAll() {
return null;
}
@Override
public String deleteFile(String filename) {
return null;
}
}
package ec.edu.espe.movilidad.MovilidadWS.service;
import ec.edu.espe.movilidad.MovilidadWS.model.ModelExample;
import java.util.List;
public interface IServiceExample {
public ModelExample ListarPorID(Long id);
public List<ModelExample> ListarRegistros();
public ModelExample guardar(ModelExample modelExample);
public ModelExample editar(Long id, ModelExample modelExample);
void eliminar(Long id);
}
package ec.edu.espe.movilidad.MovilidadWS.service;
import ec.edu.espe.movilidad.MovilidadWS.dao.DaoExample;
import ec.edu.espe.movilidad.MovilidadWS.model.ModelExample;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.engine.design.JasperDesign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ResourceUtils;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.aspectj.weaver.tools.cache.SimpleCacheFactory.path;
@Service
public class ReportService {
@Autowired
private DaoExample daoExample;
public String exportReport(String reportFormat) throws FileNotFoundException, JRException {
List<ModelExample> examples = (List<ModelExample>) daoExample.findAll();
File file = ResourceUtils.getFile("classpath:example.jrxml");
JasperReport jasperReport = JasperCompileManager.compileReport(file.getAbsolutePath());
JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(examples);
Map<String, Object> parameters = new HashMap<>();
parameters.put("createdBy", "Java Techie");
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource);
if (reportFormat.equalsIgnoreCase("html")) {
JasperExportManager.exportReportToHtmlFile(jasperPrint, "D:\\Usuario\\Nueva carpeta (2)\\TESIS\\JASPER" + "\\example.html");
}
if (reportFormat.equalsIgnoreCase("pdf")) {
JasperExportManager.exportReportToPdfFile(jasperPrint, "D:\\Usuario\\Nueva carpeta (2)\\TESIS\\JASPER"+ "\\example.pdf");
}
return "report generated in path : " + path;
}
}
package ec.edu.espe.movilidad.MovilidadWS.service;
import ec.edu.espe.movilidad.MovilidadWS.dao.DaoExample;
import ec.edu.espe.movilidad.MovilidadWS.excepciones.ControlExcepciones;
import ec.edu.espe.movilidad.MovilidadWS.model.ModelExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
@Service
public class ServiceExample implements IServiceExample{
@Autowired
private DaoExample daoExample;
@Override
public ModelExample ListarPorID(@PathVariable Long id) { // PathVariable para obtener el id que venga
return daoExample.findById(id).get();
}
@Override
public List<ModelExample> ListarRegistros() {
return (List<ModelExample>) daoExample.findAll();
}
@Override
public ModelExample guardar(ModelExample modelExample) {
return daoExample.save(modelExample);
}
@Override
public ModelExample editar(@PathVariable Long id, ModelExample modelExample) {
ModelExample example = daoExample.findById(id).get();
//.orElseThrow(()->new ControlExcepciones("No existe el registro con el ID : " + id));
//Seteamos los nuevos datos del registro
example.setName(modelExample.getName());
ModelExample exampleActualizado = daoExample.save(example);
return exampleActualizado;
}
//Eliminar un registro
@Override
public void eliminar(@PathVariable Long id) {
ModelExample example = daoExample.findById(id).get();
//.orElseThrow(() -> new ControlExcepciones("No existe el registro con el ID : " + id));
daoExample.delete(example);
}
}
# POOL CONFIG
spring.datasource.hikari.connection-timeout = 20000
#maximum number of milliseconds that a client will wait for a connection
spring.datasource.hikari.minimum-idle= 5
#minimum number of idle connections maintained by HikariCP in a connection pool
spring.datasource.hikari.maximum-pool-size= 10
#maximum pool size
spring.datasource.hikari.idle-timeout=10000
#maximum idle time for connection
spring.datasource.hikari.max-lifetime= 1000
# maximum lifetime in milliseconds of a connection in the pool after it is closed.
spring.datasource.hikari.auto-commit =true
#spring.datasource.url=jdbc:oracle:thin:@//localhost/XE
spring.datasource.url=jdbc:oracle:thin:@//localhost:1521/bddp
spring.jpa.hibernate.ddl-auto=update
spring.datasource.username=joel
spring.datasource.password=1234
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
#establecer el tamao maximo de un archivo
spring.servlet.multipart.max-file-size=5MB
#establecer el tamao maximo de varios archivos enviados a la vez de una misma solicitud
spring.servlet.multipart.max-request-size=10MB
media.location=mediafiles
spring.profiles.active=local
server.port=8080
spring.jpa.database-platform = org.hibernate.dialect.Oracle12cDialect
logging.level.org.hibernate.SQL=error
spring.servlet.multipart.max-file-size=25MB
spring.servlet.multipart.max-request-size=25MB
spring.jackson.time-zone = America/Guayaquil
spring.jackson.locale = es_CL
spring.jackson.serialization.fail-on-empty-beans=false
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.20.3.final using JasperReports Library version 6.20.3-415f9428cffdb6805c6f85bbb29ebaf18813a2ab -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Example" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8690949c-a4e5-457b-94bc-f12a990c1654">
<field name="id" class="java.lang.Long">
</field>
<field name="creationDateA" class="java.sql.Date">
</field>
<field name="creationUser" class="java.lang.String">
</field>
<field name="modificationDate" class="java.sql.Date">
</field>
<field name="modificationUser" class="java.lang.String">
</field>
<field name="name" class="java.lang.String">
</field>
<field name="state" class="java.lang.Boolean">
</field>
<background>
<band/>
</background>
<title>
<band height="72">
<frame>
<reportElement mode="Opaque" x="-20" y="-20" width="595" height="92" backcolor="#006699" uuid="cdb195c8-5c14-4b0e-aab4-cbae2941f65e"/>
<staticText>
<reportElement x="20" y="20" width="234" height="43" forecolor="#FFFFFF" uuid="0dda8566-e862-46a3-b224-09ff402e015c"/>
<textElement>
<font size="34" isBold="true"/>
</textElement>
<text><![CDATA[EXAMPLE]]></text>
</staticText>
<staticText>
<reportElement x="395" y="43" width="180" height="20" forecolor="#FFFFFF" uuid="b001df58-6f13-437f-a851-7158a2a25dc6"/>
<textElement textAlignment="Right">
<font size="14" isBold="false"/>
</textElement>
<text><![CDATA[Prueba JASPER]]></text>
</staticText>
</frame>
</band>
</title>
<pageHeader>
<band height="13"/>
</pageHeader>
<columnHeader>
<band height="21">
<line>
<reportElement x="-20" y="20" width="595" height="1" forecolor="#666666" uuid="ecf2d28f-e5fc-4e16-883a-8c3eac9bff2c"/>
</line>
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="79" height="20" forecolor="#006699" backcolor="#E6E6E6" uuid="59c1fd3b-bca8-4ca6-8c3b-a925c4dbbaae">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="de8a7ccd-da2b-470b-baa2-1d070225e687"/>
</reportElement>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[id]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="79" y="0" width="79" height="20" forecolor="#006699" backcolor="#E6E6E6" uuid="93b15115-9061-484b-ade5-b456b80a242e">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="284ed6a2-8387-43a9-bc46-1da16ba0a5ec"/>
</reportElement>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[creationDateA]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="158" y="0" width="79" height="20" forecolor="#006699" backcolor="#E6E6E6" uuid="2bb1d355-9b10-428a-ae42-a3f5ac2e5d4c">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="0245c24f-ada9-4752-8181-6624e7b05cb1"/>
</reportElement>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[creationUser]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="237" y="0" width="79" height="20" forecolor="#006699" backcolor="#E6E6E6" uuid="4dc4db90-9ec0-4a37-a6fc-b4e120eaad19">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="9b7e30a5-b7cc-4897-a1e2-48e4f831f993"/>
</reportElement>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[modificationDate]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="316" y="0" width="79" height="20" forecolor="#006699" backcolor="#E6E6E6" uuid="d42a53b1-e9a6-4343-968d-68b028217c88">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="70f29ae7-c366-485b-8550-d5642907be6a"/>
</reportElement>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[modificationUser]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="395" y="0" width="79" height="20" forecolor="#006699" backcolor="#E6E6E6" uuid="6af94b09-28df-4235-98a2-b240231f8124">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6d4bcc8f-5982-4d39-b827-af504165484f"/>
</reportElement>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[name]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="474" y="0" width="79" height="20" forecolor="#006699" backcolor="#E6E6E6" uuid="e09287c8-5572-4abe-a486-80098510ebd8">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="ba2a722d-c66a-4ecb-9194-3f1b0337bff9"/>
</reportElement>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[state]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20">
<line>
<reportElement positionType="FixRelativeToBottom" x="0" y="19" width="555" height="1" uuid="7e89a3c5-4c04-4e05-9479-f7e017556794"/>
</line>
<textField >
<reportElement x="0" y="0" width="79" height="20" uuid="abb8eb0a-2bd0-4550-b6c3-c235ec1a0437">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="de8a7ccd-da2b-470b-baa2-1d070225e687"/>
</reportElement>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{id}]]></textFieldExpression>
</textField>
<textField >
<reportElement x="79" y="0" width="79" height="20" uuid="802e6eeb-d906-4342-bfa5-f654fc365860">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="284ed6a2-8387-43a9-bc46-1da16ba0a5ec"/>
</reportElement>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{creationDateA}]]></textFieldExpression>
</textField>
<textField >
<reportElement x="158" y="0" width="79" height="20" uuid="5057fe48-c447-4f48-a6ec-b4ba5f8eebf9">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="0245c24f-ada9-4752-8181-6624e7b05cb1"/>
</reportElement>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{creationUser}]]></textFieldExpression>
</textField>
<textField >
<reportElement x="237" y="0" width="79" height="20" uuid="a9d7b616-b6a4-4229-86ca-32e73bf2828c">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="9b7e30a5-b7cc-4897-a1e2-48e4f831f993"/>
</reportElement>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{modificationDate}]]></textFieldExpression>
</textField>
<textField >
<reportElement x="316" y="0" width="79" height="20" uuid="d0fcb6e4-044c-402d-9928-17049a807407">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="70f29ae7-c366-485b-8550-d5642907be6a"/>
</reportElement>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{modificationUser}]]></textFieldExpression>
</textField>
<textField >
<reportElement x="395" y="0" width="79" height="20" uuid="b2d778a3-62fd-40bd-a80f-1863f644f354">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6d4bcc8f-5982-4d39-b827-af504165484f"/>
</reportElement>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
<textField >
<reportElement x="474" y="0" width="79" height="20" uuid="9a91f037-f544-4cf9-9edb-7a91614d8a8e">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="ba2a722d-c66a-4ecb-9194-3f1b0337bff9"/>
</reportElement>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{state}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band/>
</columnFooter>
<pageFooter>
<band height="17">
<textField>
<reportElement mode="Opaque" x="0" y="4" width="515" height="13" backcolor="#E6E6E6" uuid="e8d51b5a-34ae-45bc-b6bc-3760e4803927"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement mode="Opaque" x="515" y="4" width="40" height="13" backcolor="#E6E6E6" uuid="b60b6950-b310-4bf6-af87-2c2559f8044e"/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement x="0" y="4" width="100" height="13" uuid="04d68f1f-e5cd-403b-9d00-285dece70c77"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band/>
</summary>
</jasperReport>
package ec.edu.espe.movilidad.MovilidadWS;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class MovilidadWsApplicationTests {
@Test
void contextLoads() {
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment