Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Kotlin Spring Boot – How do you skip a property in a class with CrudRepository?

hoping this is a easy question. How do you get the CrudRepository to skip making a field in the db table? i.e.

@Table
class Property(@Id val id: String?, val name: String, val objectType: String, currentValue: String?) {
}

lets say I only wanted a table with id & name created, skipping the others. Is that possible?

Thank you!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You are seeking @Transient annotation.
Put the annotation above your field and Hibernate doesn’t persist it.

For more: Kotlin, JPA and @Transient

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading