skip to Main Content

Mysql – Springboot not creating database tables

i created my entity in springboot import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Table; @Table(name="users") @Entity public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String username; private String email; } i setted the database configuration in…

VIEW QUESTION

Spring Boot controller to handle invalid JSON

I have a Spring Boot controller that consumes JSON: @PostMapping( value = "/shipdetails") public ResponseEntity acceptShip(@RequestBody Ship ship, HttpServletRequest request) { shipService.checkShip(ship); return new ResponseEntity<>(HttpStatus.OK); } There is a corresponding Ship Entity: public class Ship implements Serializable { @JsonProperty("Name") private…

VIEW QUESTION

Json – Deserialization using jackson mapper annotations in java

I am trying to deserialize the following json using Jackson annotations. Here is my current code: @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceType") @JsonSubTypes({ @JsonSubTypes.Type(value = StripeServiceConfiguration.class, name = "Stripe"), @JsonSubTypes.Type(value = BrainServiceConfiguration.class, name = "Brain"), })…

VIEW QUESTION

Mysql – Spring JPA – Query Methods

I have this table: @Entity @Table(name = "t_tropical", uniqueConstraints = @UniqueConstraint(columnNames = { "name", "sign", "isRetro", "house", "lang"})) @Getter @Setter @AllArgsConstructor @NoArgsConstructor @Builder @ToString public class Tropical { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private String…

VIEW QUESTION

Dockerizing SpringBoot application with MySQL

My spring boot application is working fine when running it locally. But when I put that on docker it throws error saying that mysql connection cannot be made Error in the console srikulamedura-skm-server-1 | at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.9.jar!/:6.0.9] srikulamedura-skm-server-1 | at…

VIEW QUESTION
Back To Top
Search