Professional Documents
Culture Documents
Developing Enterprise Java Applications With JSF and JPA Using Eclipse WTP
Developing Enterprise Java Applications With JSF and JPA Using Eclipse WTP
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
Why ‘Dali’?
JPA supports “The Persistence of Memory”—which is the title of
a well known Salvador Dali painting.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
JPA—POJO Entities
¾ Concrete classes
¾ No required interfaces
No required business interfaces
No required callback interfaces
¾ new() for instance creation
¾ Direct access or getter/setter methods
Can contain logic (e.g. for validation, etc.)
¾ “Managed” by an EntityManager
¾ Can leave the Container (become “detached”)
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
Object-Relational Mappings
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
POJO JPA Entity
@Entity
public class Address { public class Address {
private int id; @Id
private String street; private int id;
private String city; private String street;
private String state; private String city;
private String country; private String state;
… private String country;
} …
}
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
JPA Relationship Mappings
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
JSF Tools Project
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.
Tutorial:
Class Diagram Course
St udent - id : Long
- id : Long - topic : String
- firstName : String = initval - beginDate : Date
- lastName : String - endDate : Date
+address
1..1
Address
- id : Long
- street : String
- postalCode : String
- city : String
- country : String
+ getId() : Long
+ getStreet() : String
+ getPostalCode() : String
+ getCity() : String
+ getCountry() : String
+ setId(id : Long) : void
+ setStreet(street : String) : void
+ setPostalCode(pk : String) : void
+ setCity(city : String) : void
+ setCountry(country : String) : void
© 2007 by Sinan Konya; made available under the EPL v1.0 | April 30,2007 | Eteration A.S.