In my spring app i have the below entity:
import lombok.Data;
@Data
@Entity
public class Profile {
@Id
@GeneratedValue
Long id;
String name;
String address;
String description;
String img;
public Profile(String name, String address, String description, String img) {
this.name = name;
this.address = address;
this.description = description;
this.img = img;
}
}
and then the repository is:
@Repository
public interface ProfileRepository extends JpaRepository<Profile,Long> {
}
Here is my pom.xml
:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
So, i expect when i go to the h2 console uri:
http://localhost:8080/h2-console/login.do?jsessionid=ae6ba7021a23e0ebb4a4844381546e72
It shows the table related to the object Profile
.
The problem is: there is no table called Profile.
So, why i don't have the profile table?
The application.properties
is empty
And when i run my application, it says:
[2m2017-06-29 10:07:21.106[0;39m [32m INFO[0;39m [35m51392[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36morg.hibernate.dialect.Dialect [0;39m [2m:[0;39m HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
[2m2017-06-29 10:07:21.557[0;39m [32m INFO[0;39m [35m51392[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36morg.hibernate.tool.hbm2ddl.SchemaExport [0;39m [2m:[0;39m HHH000227: Running hbm2ddl schema export
[2m2017-06-29 10:07:21.557[0;39m [32m INFO[0;39m [35m51392[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36morg.hibernate.tool.hbm2ddl.SchemaExport [0;39m [2m:[0;39m HHH000230: Schema export complete
So, it seems that, the application makes the schema of database. Am i right?