spring-boot

Load multiple yaml file with same root key in spring boot

本秂侑毒 提交于 2021-02-11 13:01:45
问题 I'm looking for a solution in spring boot where I can maintain same root key in multiple files and load it to a POJO. application-profile-1.yml active: configuration: - name: abc ....... (1000 lines in config) application-profile-2.yml active: configuration: - name: xyz ....... (900 lines in config) application-profile-3.yml active: configuration: - name: abc ....... (700 lines in config) application.yml spring.profiles.include: profile-1,profile-2,profile-3 @ConfigurationProperties(prefix =

Why is findOne(<id>, <depth>) getting unacceptably slow performance when adding more nodes of the same label?

寵の児 提交于 2021-02-11 13:01:44
问题 CONTEXT I've been developing a spring boot website backed by a Neo4j database. It is designed to work as a university course search system. (the relevant structure is that courses have modulesets, that have modules, that are related to subjects, etc...) @JsonIdentityInfo(generator=JSOGGenerator.class) public class Course extends DomainObject { @NotNull private String name; @NotNull private String courseCode; private String description; private School school; @Convert(AttendanceTypeConverter

Spring boot JPA many to many with extra column insert and update issue

大城市里の小女人 提交于 2021-02-11 13:00:30
问题 Here is my initial question. Spring Data JPA Many to Many with extra column User and Roles Now I have the right tables created, but can't make it work for the update. Here is the code: User.java @Entity @Table(name = "users") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String username; @OneToMany(mappedBy="user", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) private List<UserRole> roles; // getters and setters

Spring boot JPA many to many with extra column insert and update issue

耗尽温柔 提交于 2021-02-11 13:00:29
问题 Here is my initial question. Spring Data JPA Many to Many with extra column User and Roles Now I have the right tables created, but can't make it work for the update. Here is the code: User.java @Entity @Table(name = "users") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String username; @OneToMany(mappedBy="user", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) private List<UserRole> roles; // getters and setters

Spring boot JPA many to many with extra column insert and update issue

吃可爱长大的小学妹 提交于 2021-02-11 12:59:24
问题 Here is my initial question. Spring Data JPA Many to Many with extra column User and Roles Now I have the right tables created, but can't make it work for the update. Here is the code: User.java @Entity @Table(name = "users") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String username; @OneToMany(mappedBy="user", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) private List<UserRole> roles; // getters and setters

@Transactional annotation does not rollback RuntimeException even if @EnableTransactionManagement is provided

旧巷老猫 提交于 2021-02-11 12:54:26
问题 I have the following application setup: @SpringBootApplication @EnableTransactionManagement public class MyApp extends SpringBootServletInitializer { ... } with a class which has the following: public class DoStaff { public void doStaffOnAll(List<MyObject> myObjects) { for (int i=0; i<myObjects.size(); i++) { try { doStaffOnSingle(myObjects.get(i), i); } catch (Exception e) { e.printStrackTrace(); } } } @Transactional public void doStaffOnSingle(MyObject myObject, int i) { repository.save

How to deploy a Spring boot application to weblogic 12.2.1.3.0 without deploy a WAR file?

安稳与你 提交于 2021-02-11 12:42:37
问题 I have no right to access the weblogic.Deployer stuff nor the web admin GUI (if that exists in Linux server version) I can only upload file via FTP to a deployment folder (there are jsp/META-INF/WEB-INF sub folders) where the admin setup to us. And the admin also provide us a script to restart the app server. (OS is linux) I wonder if this is possible to unzip the WAR file and upload files to server and restart the app server to get it started? I actually tried and unable to see any spring

Customize parameters of a step in Spring Batch application

喜你入骨 提交于 2021-02-11 12:41:17
问题 I am working with Spring Batch(using Spring boot). My requirement is to read data from db, process it(validations and stuffs) and write it to a file. I am trying to achieve this using a batch step. Problem is , if i define a step, the reader,processor and writer should be having similar parameters.(from examples i saw and the error i got) Like if my reader is returning a db domain object, the processor and writer should be having domain object parameters. What i am looking for is , reader

Customize parameters of a step in Spring Batch application

爱⌒轻易说出口 提交于 2021-02-11 12:40:52
问题 I am working with Spring Batch(using Spring boot). My requirement is to read data from db, process it(validations and stuffs) and write it to a file. I am trying to achieve this using a batch step. Problem is , if i define a step, the reader,processor and writer should be having similar parameters.(from examples i saw and the error i got) Like if my reader is returning a db domain object, the processor and writer should be having domain object parameters. What i am looking for is , reader

Role based authorization: Oauth with OneLogin and Spring Security

放肆的年华 提交于 2021-02-11 12:40:10
问题 I have a spring boot application which is using Oauth with OneLogin as the authorisation server. Now, I want to implement role based authorisation to expose certain APIs only to users with certain privileges. I have users belonging to groups. Say user A belongs to "admin" group and user B does not belong to the admin group. My question is how can I use these groups to enable only user A to access certain APIs. This is the information about the authenticated user for reference: authorities 0