Pro JPA 2: Mastering the JavaTM Persistence API (Expert's Voice in Java Technology)

Pro JPA 2 introduces, explains, and demonstrates the right way to use the Java patience API (JPA). JPA presents Java builders with either the data and perception had to write Java functions that entry relational databases via JPA.

Authors Mike Keith and Merrick Schincariol take a hands–on method of educating via giving examples to demonstrate each one proposal of the API and displaying the way it is utilized in practice.

the entire examples use a typical version from an overriding pattern software, giving readers a context from which to begin and aiding them to appreciate the examples inside of an already primary area.

After finishing the publication, you might have an entire knowing and be capable to effectively code functions utilizing JPA. The booklet additionally serves as a reference advisor in the course of preliminary and later JPA program experiences.

  • Hands-on examples for all of the elements of the JPA specification, in line with the reference implementation of this specification
  • A precise part on migration to JPA
  • Expert perception approximately quite a few facets of the API and once they are precious
  • Portability tricks to supply elevated know-how of the possibility of non–portable JPA code

What you’ll learn

  • Get all started with firm functions utilizing JPA 2
  • Get on top of things with object–relational mapping and Entity supervisor
  • Learn and use queries and the question language (JP QL)
  • Employ complicated object–relational mapping recommendations
  • Use XML mapping documents and research different complex innovations
  • Package and install your Java endurance functions
  • Test your Java endurance purposes
  • Migrate your Java endurance purposes

Who this ebook is for

The ebook normally objectives company and endurance builders who fall in a single of 3 categories:

  • Those who're new to endurance; we are going to current a few history details and introduce those readers to the elemental endurance innovations to convey them up to the mark.
  • Those who recognize and/or use existing ORM patience items equivalent to Hibernate or TopLink.
  • Those who've already used JPA and wish to profit about newer features introduced by JPA 2, or have an excellent reference ebook to refer to after they improve JPA functions.

In common, we imagine that the reader is a professional with Java, SQL, and JDBC, and has a bit wisdom of J2EE.

Table of Contents

  1. Introduction
  2. Getting begun
  3. Enterprise purposes
  4. Object-Relational Mapping
  5. Collection Mapping
  6. Entity supervisor
  7. Using Queries
  8. Query Language
  9. Criteria API
  10. Advanced Object-Relational Mapping
  11. Advanced themes
  12. XML Mapping documents
  13. Packaging and Deployment
  14. Testing
  15. Migration

Show description

Quick preview of Pro JPA 2: Mastering the JavaTM Persistence API (Expert's Voice in Java Technology) PDF

Similar Java books

Mastering Lambdas: Java Programming in a Multicore World (Oracle Press)

The Definitive consultant to Lambda Expressions studying Lambdas: Java Programming in a Multicore international describes how the lambda-related good points of Java SE eight will permit Java to fulfill the demanding situations of next-generation parallel architectures. The ebook explains the right way to write lambdas, and the way to exploit them in streams and in assortment processing, offering code examples all through.

Mastering JavaFX 8 Controls (Oracle Press)

Layout and installation High-Performance JavaFX Controls carry state of the art functions with visually attractive UIs. getting to know JavaFX eight Controls offers transparent directions, certain examples, and ready-to-use code samples. easy methods to paintings with the most recent JavaFX APIs, configure UI parts, instantly generate FXML, construct state-of-the-art controls, and successfully practice CSS styling.

Data Abstraction and Problem Solving with Java: Walls and Mirrors (3rd Edition)

The 3rd version of information Abstraction and challenge fixing with Java: partitions and Mirrors employs the analogies of partitions (data abstraction) and Mirrors (recursion) to educate Java programming layout strategies, in a fashion that starting scholars locate available. The booklet has a student-friendly pedagogical procedure that conscientiously money owed for the strengths and weaknesses of the Java language.

Java Software Solutions: Foundations of Program Design (7th Edition)

Java software program options teaches a beginning of programming strategies to foster well-designed object-oriented software program. Heralded for its integration of small and big lifelike examples, this world wide best-selling textual content emphasizes construction reliable problem-solving and layout abilities to put in writing high quality courses.

Additional info for Pro JPA 2: Mastering the JavaTM Persistence API (Expert's Voice in Java Technology)

Show sample text content

Classification) @Column(name="PHONE_NUM") deepest Map phoneNumbers; // ... The @MapKeyClass annotation can be used each time the most important category can't be deduced from the characteristic definition or the opposite mapping metadata. principles for Maps studying in regards to the a number of Map editions can get type of complicated provided that we will decide on anyone of 3 other forms of key varieties and 3 other kinds of price kinds. lower than are a few of the easy ideas of utilizing a Map. • Use the @MapKeyClass and targetEntity/targetClass parts of the connection and point assortment mappings to specify the periods while an untyped Map is used. • Use @MapKey with one-to-many or many-to-many dating Map that's keyed on an characteristic of the objective entity. • Use @MapKeyJoinColumn to override the subscribe to column of the entity key. • Use @Column to override the column storing the values of a component selection of easy varieties. • Use @MapKeyColumn to override the column storing the keys whilst keyed by way of a easy kind. • Use @MapKeyTemporal and @MapKeyEnumerated if you would like to additional qualify a easy key that could be a temporal or enumerated sort. • Use @AttributeOverride with a “key. ” or “value. ” prefix to override the column of an embeddable characteristic variety that may be a Map key or a price, respectively. desk 5-1 summarizes the various various facets of utilizing a Map. a hundred twenty five CHAPTER five ■ assortment MAPPING desk 5-1. precis of Mapping a Map Map Mapping Key Annotation price Annotation Map @ElementCollection @MapKeyColumn, @Column @MayKeyEnumerated, @MapKeyTemporal Map @ElementCollection @MapKeyColumn, @MayKeyEnumerated, @MapKeyTemporal Map @OneToMany, @ManyToMany @MapKey, Mapped by means of embeddable, @AttributeOverride, @AssociationOverride Mapped via entity @MapKeyColumn, @MayKeyEnumerated, @MapKeyTemporal Map @ElementCollection Mapped through embeddable, @Column @AttributeOverride Map @ElementCollection Mapped via embeddable, @AttributeOverride Mapped via embeddable, @AttributeOverride, @AssociationOverride Map @OneToMany, @ManyToMany Mapped by means of embeddable Mapped by way of entity Map @ElementCollection @MapKeyJoinColumn @Column Map @ElementCollection @MapKeyJoinColumn Mapped through embeddable, @AttributeOverride, @AssociationOverride Map @OneToMany, @ManyToMany @MapKeyJoinColumn Mapped by way of entity Duplicates once we have been discussing the Set interface we pointed out that it used to be perfect for fighting duplicates. What we intended was once that the Set datatype in Java doesn't enable them. We didn’t fairly say something 126 CHAPTER five ■ assortment MAPPING approximately duplicates within the database. in truth, the JPA specification doesn't say whatever approximately no matter if duplicates are allowed in collections, both within the database or in reminiscence, and generally they won't be supported. To get a sense for why aiding duplicates is tough, we have to visit the knowledge version and discover the various gory information.

Download PDF sample

Rated 4.62 of 5 – based on 32 votes