Introducing Spring Framework 6 by Felipe Gutierrez & Joseph B. Ottinger

Introducing Spring Framework 6 by Felipe Gutierrez & Joseph B. Ottinger

Author:Felipe Gutierrez & Joseph B. Ottinger
Language: eng
Format: epub
ISBN: 9781484286371
Publisher: Apress


dependencies {

implementation
"org.springframework.boot:spring-boot-starter-data-jpa"

implementation
"org.springframework.boot:spring-boot-starter-test"

testImplementation
"org.testng:testng:$testNgVersion"

implementation
"com.h2database:h2:2.1.214"

}

Listing 7-1chapter07/build.gradle

Next, let’s take a look at the data model – the DocumentType and Document classes, which will be very (very) similar to the classes we saw in Chapter 6. The biggest difference is in Document, because we’re adding JPA mapping annotations to the class; we have to define the entity and its primary key, at the very least. We could do so with XML configuration files for Hibernate or JPA, but the simplest and most common approach is to use annotations as we’ve done here. The only “interesting” aspect to the mapping is for the type field, which we’re mapping as a String to match our data model from Chapter 6.package c07;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.