Is there any way in spring boot for hibernate to add some data.sql
only after particular entity-table is created. (I don't want initialization of schema & data while initializing spring boot application)
package io.fall.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "userprofile")
public class UserProfile {
@Id
@GeneratedValue
private int id;
private int theme;
private String userName;
UserProfile(){}
public int getTheme() {
return theme;
}
public void setTheme(int theme) {
this.theme = theme;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}
I want to insert these values after hibernate creates entity-table userprofile
INSERT INTO userprofile (id,theme,userName,summary)
VALUES (1, 1 , 'John Doee'),
(2, 2 , 'Jenny Doee'),
(3, 3 , 'James Doee');