dev-resources.site
for different kinds of informations.
Mapping with SCHEMA
Published at
10/15/2022
Categories
oracle
micronaut
jdbc
Author
e240683
Main Article
Author
7 person written this
e240683
open
Una mala pr谩ctica en la configuraci贸n de aplicaciones, es usar el owner del esquema para acceder a la base de datos.
Es recomendable crear una cuenta de usuario y otorgar los permisos necesarios y espec铆ficos.
Pongamos como ejemplo:
- ESQUEMA: REGIONALIZACION
- USUARIO: MSPRODUCTOSWOW
- PERMISOS:
-- Oracle
GRANT SELECT, INSERT, UPDATE
ON REGIONALIZACION.LGT_PROD_LOCAL_OFERTA_AUX
TO MSPRODUCTOSWOW
Empleando las anotaciones de Jakarta Persistence, definimos el mapping de nuestra Entity: name/schema.
import jakarta.persistence.*;
@Table(name = "LGT_PROD_LOCAL_OFERTA_AUX", schema = "REGIONALIZACION")
public record WOWProduct(@EmbeddedId WOWProductId id,
float porcDctoOferta,
LocalDateTime fecIniVigOferta,
LocalDateTime fecFinVigOferta,
String usuCreaProdLocOfe,
LocalDateTime fecCreaProdLocOfe) {
}
N贸tese que podemos usar record, incluso para definir una llave compuesta.
@Embeddable
record WOWProductId(
@Column(name = "COD_GRUPO_CIA") String codGrupoCia,
@Column(name = "COD_LOCAL") String codLocal,
@Column(name = "COD_OFERTA") String codOferta,
@Column(name = "COD_PROD") String codProd) {
}
Ejecutamos nuestro proyecto basado en #Micronaut:
Documentaci贸n
https://micronaut-projects.github.io/micronaut-data/latest/guide/#sqlAnnotations
https://github.com/edgargs/mn-jdbc-schema
micronaut Article's
30 articles in total
Pub-sub Redis in Micronaut
read article
Choosing the Right Java Microservices Framework: Spring Boot, Quarkus, Micronaut, and Beyond
read article
Micronaut vs. Spring Boot: A Detailed Comparison
read article
[Micronaut] Receiving Japanese(Shift-JIS) data as HTTPResponse
read article
[Micronaut] Try Cookie
read article
[Micronaut] Generating and downloading files as ZIP or JSON
read article
Sending files from Micronaut applications
read article
[Micronaut] Receiving multipart/form-data
read article
Try Micronaut and Doma2
read article
[Micronaut] Accessing SQL Server 2
read article
Serving static assets with Micronaut
read article
Run a Micronaut application on Tomcat
read article
[Micronaut] Accessing SQL Server 3
read article
[Micronaut] Accessing SQL Server 1
read article
Try Micronaut
read article
Adding AI to your Micronaut search service
read article
Swagger-Operator, let groovy operate your cluster
read article
Jugando con Mono y Flux (de Reactor)
read article
Meeting & Mastering Java
read article
Integration testing in Micronaut
read article
mapping OpenAPI formats
read article
Connecting Micronaut to MongoDB database using Kotlin
read article
馃 Micronaut: Top 5 Server-Side Frameworks for Kotlin in 2022
read article
AWS Lambda SnapStart - Part 2 Measuring Java 11 Lambda cold starts with Micronaut framework
read article
Integration Tests with Micronaut and Kotlin
read article
Mapping with SCHEMA
currently reading
annotation mapping & bean-validation
read article
Can Micronaut replace Spring Boot? Let's take a look at an example.
read article
Cloud Native Java: Integrating YugabyteDB with Spring Boot, Quarkus, and Micronaut
read article
Micronaut Pulsar
read article
Featured ones: