an introduction to Java Annotations Walter Harley BEA Systems Inc.
Java Annotations
-
Upload
stone-larsen -
Category
Documents
-
view
23 -
download
2
description
Transcript of Java Annotations
![Page 1: Java Annotations](https://reader036.fdocuments.in/reader036/viewer/2022082818/568135ca550346895d9d2d86/html5/thumbnails/1.jpg)
Java Annotations
• Were introduced in Java SE 5 (Sep, 2004)• Annotations are used to tell the compiler to
take additional actions• The @ sign is used to indicate the presence of
an annotated class, field or method (@IgnoreWarnings, @Path, etc..)
![Page 2: Java Annotations](https://reader036.fdocuments.in/reader036/viewer/2022082818/568135ca550346895d9d2d86/html5/thumbnails/2.jpg)
Java Persistence Architecture (JPA)
• JPA is a Java API specification that allows developers to describe low level database designs and behaviors using annotations in the Java code.
• Object Relational Mapping (ORM) is the concrete vendor specific implementation of JPA (i.e. – Hibernate, TopLink, etc.)
![Page 3: Java Annotations](https://reader036.fdocuments.in/reader036/viewer/2022082818/568135ca550346895d9d2d86/html5/thumbnails/3.jpg)
Java API for RESTful Web Services(JAX-RS)
• JAX-RS is the part of the Java EE standard that facilitates RESTful web services.
• RESTful behavior can be realized purely through the addition of JAX-RS Annotations
![Page 4: Java Annotations](https://reader036.fdocuments.in/reader036/viewer/2022082818/568135ca550346895d9d2d86/html5/thumbnails/4.jpg)
Java Architecture for XML Binding(JAXB)
• JAXB facilitates the use of annotations to describe the XML or JSON structure of an object architecture
![Page 5: Java Annotations](https://reader036.fdocuments.in/reader036/viewer/2022082818/568135ca550346895d9d2d86/html5/thumbnails/5.jpg)
JPA Annotations
• @Entity• @Table• @Column• @OneToMany• @ManyToOne• @JoinColumn• @Embeddable• @Embedded
• @Id• @NamedQueries• @NamedQuery• @SequenceGenerator• @GeneratedValue• @Enumerated• EnumType• @PersistenceContext• TypedQuery
![Page 6: Java Annotations](https://reader036.fdocuments.in/reader036/viewer/2022082818/568135ca550346895d9d2d86/html5/thumbnails/6.jpg)
JAX-RS Annotations
• @ApplicationPath• @Path• @PathParam• @QueryParam• @Produces• @Consumes
• @GET• @POST• @PUT• @DELETE
![Page 7: Java Annotations](https://reader036.fdocuments.in/reader036/viewer/2022082818/568135ca550346895d9d2d86/html5/thumbnails/7.jpg)
JAXB Annotations
• @XmlRootElement• @XmlElement• @XmlAccessorType• XmlAccessType• @XmlElementWrapper
![Page 8: Java Annotations](https://reader036.fdocuments.in/reader036/viewer/2022082818/568135ca550346895d9d2d86/html5/thumbnails/8.jpg)
JAXB Annotations
• @XmlRootElement• @XmlElement• @XmlAccessorType• XmlAccessType• @XmlElementWrapper
![Page 9: Java Annotations](https://reader036.fdocuments.in/reader036/viewer/2022082818/568135ca550346895d9d2d86/html5/thumbnails/9.jpg)
The project
• https://git.psu.edu/ais-swe/web-conference
![Page 10: Java Annotations](https://reader036.fdocuments.in/reader036/viewer/2022082818/568135ca550346895d9d2d86/html5/thumbnails/10.jpg)
Running the VM
• Navigate to the directory you want the web-conference project installed
• git clone https://git.psu.edu/ais-swe/web-conference.git
• cd web-conference/ • git submodule init • git submodule update • cd web-conference-vagrant/ • vagrant up