I'm starting with a Spring Boot + WebFlux + Postgresql project.
It is necessary to carry out the mapping of the bank schema, but in the @Table annotation the schema information is not present, thinking about it I wanted to understand how it would be possible to carry out the mapping for a table contained in a schema.
Table
select id, description from myschema.mytable;
Mapping
package br.com.myschema.example;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table
public class MyTableEntity {
@Id
private Long id;
private String description;
}
How would it be possible to define for the spring-data that I am accessing the owner myschema?
Try to execute a initial script using ConnectionFactoryInitializer to select the schema to use.