Convert DB into mapped classes Spring Boot JPA Hibernate

I'm using Spring Boot with Hibernate JPA and Gradle, how I can transform an already existing MariaDB database into mapped Java classes using Hibernate? Which dependencies and configurations are minimally needed?
9 Replies
JavaBot
JavaBot6mo ago
This post has been reserved for your question.
Hey @Franscis123$#! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st6mo ago
I mean you would create the data structure as normal and you can then add annotations whereever the names in the DB don't match the standard JPA names
Franscis123$#
Franscis123$#OP6mo ago
I mean the reverse operation of the ORM, instead to create the DB using the mapped classes when run the application, create the classes by the schema with a command.
JavaBot
JavaBot6mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
daysling
daysling6mo ago
You mean code generations for your migration files?
JavaBot
JavaBot6mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Dexter
Dexter6mo ago
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.mariadb.jdbc:mariadb-java-client'
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.mariadb.jdbc:mariadb-java-client'
}
This message has been formatted automatically. You can disable this using /preferences.
Karlas2
Karlas26mo ago
spring.datasource.url=jdbc:mariadb://localhost:3306/your_database spring.datasource.username=your_username spring.datasource.password=your_password spring.datasource.driver-class-name=org.mariadb.jdbc.Driver spring.jpa.hibernate.ddl-auto=none spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialect
JavaBot
JavaBot6mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?