25.02.2015 Views

Introducing Spring Framework

Introducing Spring Framework

Introducing Spring Framework

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 9 ■ Adding Persistence to Your <strong>Spring</strong> Application<br />

}<br />

}<br />

builder.append(", location: ");<br />

builder.append(location);<br />

builder.append(")");<br />

return builder.toString();<br />

Listing 9-1 shows the Document class; here you added the Type class that will hold the relationship shown in<br />

Figure 9-1. You also added new properties like the created and modified dates, and a documentId. Now let’s take a<br />

look at Listing 9-2, which shows the Type class.<br />

Listing 9-2. Type.java<br />

package com.apress.isf.java.model;<br />

public class Type {<br />

private String typeId;<br />

private String name;<br />

private String desc;<br />

private String extension;<br />

public Type(){<br />

}<br />

public Type(String name,String extension){<br />

this.name = name;<br />

this.extension = extension;<br />

}<br />

public String getTypeId() {<br />

return typeId;<br />

}<br />

public void setTypeId(String typeId) {<br />

this.typeId = typeId;<br />

}<br />

public String getName() {<br />

return name;<br />

}<br />

public void setName(String name) {<br />

this.name = name;<br />

}<br />

public String getDesc() {<br />

return desc;<br />

}<br />

114

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!