EJB 3 Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule

Size: px
Start display at page:

Download "EJB 3 Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule"

Transcription

1 Berner Fachhochschule Technik und Informatik EJB 3 Entities Course Multi Tier Business Applications with Java EE Prof. Dr. Eric Dubuis Berner Fachhochschule Biel

2 Content Characteristics of entities Programming aspects Primary keys An example The entity manager and persistence unit Entities' life cycle Embeddable classes April 25, 2008 MTA with Java EE / Stateless Session Beans 2

3 What Are EJB 3.0 Entities? An EJB 3.0 entity is a lightweight persistent domain object, programmed as POJO. Properties: entities are long-lived Think of an object that represents a row in a table of a relational database. The columns' cells corresponds to instance variables of the object. entities survive server restarts1 entities survive server failures entities are a view into a database/a persistent store entities instances can be pooled entities can be created, removed, or found EJB entities are based on the Java Persistence API which can be used outside of a container, too. These notes handle inside-container usage only. April 25, 2008 MTA with Java EE / Stateless Session Beans 3

4 What are Entities Used For? Entities are used for: To denote durable things (domain objects) such as: Customer Account Order Resources such as cabins,... etc. Note: An EJB container must support also the heavy-weight EJB 2.x entity beans. (not discussed) April 25, 2008 MTA with Java EE / Stateless Session Beans 4

5 Requirements on the Entity Class [EJB Persistence, 2.1ff] The entity class must be annotated with annotation (or denoted in the XML descriptor as an public class CustomerEntity { // optional: may implement // business interface... The entity class must have a no-arg constructor. The entity class may have other constructors as well. The no-arg constructor must be public or protected. Class must not be final, no interface, and no enum. If an entity instance is to be passed by value as a detached object (e.g., through a remote interface), the entity class must implement the Serializable interface. import javax.persistence.entity import public class CustomerEntity implements Serializeable {... April 25, 2008 MTA with Java EE / Stateless Session Beans 5

6 Requirements on the Entity Class (continued) Entities support inheritance, polymorphic associations, and polymorphic queries. Instance variables must be private, protected, or package visible (<== state). Both, abstract and concrete classes can be entities. Entities may extend non-entity classes as well as entity classes, and non-entity classes may extend entity classes. The state of the entity is available to clients only through the entity s accessor methods (getter/setter methods) or other business methods. «entity» P «entity» Q «entity» A {abstract «entity» B * 1 «entity» Z queries: return Q's, too association: Q's are associated with Z's, too «class» C {abstract «entity» D April 25, 2008 MTA with Java EE / Stateless Session Beans 6

7 Definition Entity { String name() default ""; The name annotation element defaults to the unqualified name of the entity class. This name is used to refer to the entity in queries. The name must not be a reserved literal (key word) in EJB QL. EJB QL (or JPQL): query language of the Java Persistence API. April 25, 2008 MTA with Java EE / Stateless Session Beans 7

8 Definition of the Access Type The persistent state is accessed by the persistence provider runtime via: Field access: For public class CustomerEntity... private int id; Property access: For public class CustomerEntity... { private int public Object getid() { return this.id; public void setid(object id) { this.id = id; A single access type (field or property access) applies to an entity hierarchy. April 25, 2008 MTA with Java EE / Stateless Session Beans 8

9 Properties of Persistent Fields The persistent fields or properties of an entity may be of the following types: Java primitive types; java.lang.string; other Java serializable types (including wrappers of the primitive types, java.math.biginteger, java.math.bigdecimal, java.util.date, java.util.calendar, java.sql.date, java.sql.time, java.sql.timestamp, user-defined serializable types, byte[], Byte[], char[], and Character[]); enum's; entity types and/or collections of entity types; and embeddable classes (see [EJB Persistence, 2.1.5]). Can pass entities / collections of entities from container to client or vice versa... April 25, 2008 MTA with Java EE / Stateless Session Beans 9

10 Properties of Persistent Fields (continued) The persistent state of an entity is accessed by the persistence provider runtime either via JavaBeans style property accessors or via instance variables. If the entity has field-based access, the persistence provider runtime accesses instance variables directly. All non-transient instance variables that are not annotated with annotation are persistent. When field-based access is used, the object/relational mapping annotations for the entity class annotate the instance variables. If the entity has property-based access, the persistence provider runtime accesses persistent state via the property accessor methods. All properties not annotated with annotation are persistent. The property accessor methods must be public or protected. When property-based access is used, the object/relational mapping annotations for the entity class annotate the getter property accessors. April 25, 2008 MTA with Java EE / Stateless Session Beans 10

11 Properties of Persistent Fields (continued) Method signatures for single-valued properties: T getproperty() void setproperty(t t) Collection-valued persistent fields and properties must be defined by the following Java Collection Framework interfaces (for example: Set<Order>): java.util.collection java.util.set java.util.list java.util.map For an ordering of members, see [EJB Core, p.19, footnote 4]. April 25, 2008 MTA with Java EE / Stateless Session Beans 11

12 Primary Keys Every entity must have a primary key. A simple primary key corresponds to a single persistent field or property. A composite primary key corresponds to: (==> implies primary key class) either to a single persistent field or property or a set of fields or properties. A primary key (or field or property of a composite primary key) must be: a Java primitive type; any primitive wrapper type; java.lang.string or java.util.date or java.sql.date Note 1: Approximate numeric (floating point types such as double) must not be used. Note 2: Primary key classes: not discussed, see [EJB Persistence 2.1.4]. April 25, 2008 MTA with Java EE / Stateless Session Beans 12

13 Primary Annotation annotation selects the identifier property an entity root Id { public class private int id; // getter only: public Object getid() { return this.id; autoboxing April 25, 2008 MTA with Java EE / Stateless Session Beans 13

14 Id Generation Strategy I You can specify the Id generation strategy. public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO GeneratedValue { GenerationType strategy() default AUTO; String generator() default ""; April 25, 2008 MTA with Java EE / Stateless Session Beans 14

15 Id Generation Strategy Type Name Description Default GenerationType strategy String (Optional) The primary key generation strategy that the persistence provider must use to generate the annotated entity primary key. generator (Optional) The name of the primary key generator to use as specified in the SequenceGenerator or TableGenerator annotation. GenerationType.AUTO Default id generator supplied by persistence provider Some Notes on the Primary Key Generation Use GenerationType.TABLE when using entity bean inheritance. For more informations, see [EJB Persistence, 9.1.9] April 25, 2008 MTA with Java EE / Stateless Session Beans 15

16 A First Entity Example: = "EJB3_SALES_CUSTOMER") // Default: Bean class name public class CustomerEntity implements Customer, Serializable // field access // GenerationType.AUTO will be used private int id; private String firstname; private String lastname; public CustomerEntity() { // public no-arg constructor public CustomerEntity(String firstname, String lastname) { this.firstname = firstname; this.lastname = lastname; // continued... April 25, 2008 MTA with Java EE / Stateless Session Beans 16

17 A First Entity Example: A Customer (continued) // Needed by application itself: public int getid() { return this.id; public String getfirstname() { return this.firstname; public void setfirstname(string firstname) { this.firstname = firstname; // other setters and getters omitted... April 25, 2008 MTA with Java EE / Stateless Session Beans 17

18 A First Entity Example: Remarks An entity class may implement the business interface. An entity class must have a public (or protected) no-arg constructor. An entity class may have other constructors as well. An entity class may implement the Serializable interface; if so, instances of that class can be detached and passed to remote clients. An instance of an entity class is created via the new operator, see below. When first created, the entity bean is not yet persistent. An entity instance becomes persistent by means of the entity manager, see below. April 25, 2008 MTA with Java EE / Stateless Session Beans 18

19 A Stateless Session Bean as Customer Manager Let's introduce a stateless session bean to manage (create, list, and update) Customer beans. The manager's remote (business) interface import public interface CustomerManager { public Object createcustomer(customer customer); public Customer getcustomerbyid(object id); public ValueListHandler<Customer> getcustomerlisthandler(string pattern); // *) public void updatecustomer(customer customer); public void deletecustomer(object id); *) See the Value List Handler Java EE pattern at: April 25, 2008 MTA with Java EE / Stateless Session Beans 19

20 A Stateless Session Bean as Customer Manager (cont'd) The Bean Class import java.util.*; import javax.ejb.stateless; import javax.persistence.entitymanager; import javax.persistence.persistencecontext; import javax.persistence.query; injected by the public class CustomerManagerBean implements CustomerManager private EntityManager manager; // business methods shown on next slide. April 25, 2008 MTA with Java EE / Stateless Session Beans 20

21 A Stateless Session Bean as Customer Manager (con'd) instance of type The Bean Class (continued) CustomerEntity is given // in class CustomerManagerBean: public Object createcustomer(customer customer) { this.manager.persist(customer); return customer.getid(); public ValueListHandler<Customer> getcustomerlisthandler(string pattern) { // See exercise. return valuelisthandler; public void updatecustomer(customer customer) { this.manager.merge(customer); merge() is not void public void deletecustomer(object id) { Customer c = this.manager.find(customerentity.class, id); this.manager.remove(c); April 25, 2008 MTA with Java EE / Stateless Session Beans 21

22 Excerpt of a Client A client creates, lists, and modifies Customer entities with the help of the CustomerManager instance: public class SalesClient { private EntityFactory factory =...; { // in some method: CustomerManager cm = getservicelocator().getcustomermanager(); factory Customer customer = shields factory.createcustomer("hans", "..:",...); technology cm.createcustomer(customer); service locator is used here // list customers, update, and delete customers... April 25, 2008 MTA with Java EE / Stateless Session Beans 22

23 The Entity Manager [EJB Persistence, 3ff.] Purpose: The entity manager manages the entity instance life cycle. Persistence context: [...] A set of entity instances in which for any entity identity there is a unique entity instance. The entity manager defines methods to interact with the persistence context. April 25, 2008 MTA with Java EE / Stateless Session Beans 23

24 Entity Manager API (Excerpt) package javax.persistence; persist(): for creating new entities merge(): for updating public interface EntityManager { public void persist(object entity); public <T> T merge(t entity); public void remove(object entity); public <T> T find(class<t> entityclass, Object existing entities primarykey);... public void flush(); public void refresh(object entity); public boolean contains(object entity); public Query createquery(string ejbqlstring); public Query createnamedquery(string name); Will be treated later April 25, 2008 MTA with Java EE / Stateless Session Beans 24

25 What is the Persistence Provider? A mechanism to transfer entity information back and forth between the Java object (POJO1) and the database. Most often: relational database, but could also be an object database. A concrete persistence provider must implement the Persistence Provider SPI (SPI: service provider interface) It's the duty of the persistence provider to worry about the proper time to load, store, and refresh the data of the entity. April 25, 2008 MTA with Java EE / Stateless Session Beans 25

26 Accessing the Persistence Context Use annotation to declare an EntityManager instance variable of a session bean. The EJB container injects the/a persistence context. By default, entities stay managed within the scope of a single transaction: // in a stateless session private EntityManager manager; public void transfer(int acno1, int acno2, double amount) { Account account1 = this.manager.find(account.class, acno1); Account account2 = this.manager.find(account.class, acno2); account1.withdraw(amount); account2.deposit(amount); April 25, 2008 MTA with Java EE / Stateless Session Beans 26

27 Accessing the Persistence Context (cont'd) To keep an entity managed during the span of several transactions, you'll use an extended persistence context: // in a stateful session = PersistenceContextType.EXTENDED) private EntityManager manager; Account managed during several private Account account = null; method calls public void open(int num) { this.account = this.manager.find(account.class, num); public void deposit(double amount) { if (this.account == null) throw new IllegalStateException("..."); this.account.deposit(amount); April 25, 2008 MTA with Java EE / Stateless Session Beans 27

28 Defining a Persistence Unit A persistence unit must be defined in the XML file persistence.xml the JAR's META-INF directory. It can be as simple as: <?xml version="1.0" encoding="utf-8"?> <persistence> <persistence-unit name="sales"> <jta-data-source>java:/defaultds</jta-data-source> <properties> <property </properties> </persistence-unit> </persistence> name="hibernate.hbm2ddl.auto" value="create-drop"/> JNDI name of data source appserver specific April 25, 2008 MTA with Java EE / Stateless Session Beans 28

29 Entities' Life Cycle An entity is in one of the following states: new persist New Managed remove persist Removed merge persistence context ends Detached April 25, 2008 MTA with Java EE / Stateless Session Beans 29

30 Embeddable Classes [EJB Persistence, 2.1.5] An entity may use a fine-grained class. For example, entity Customer may use an Address instance, but this instance exists only as embedded object of the entity to which it belongs. Embeddable classes: are ordinary POJOs implement java.io.serializable cannot be shared among entities access type is determined by the enclosing entity class Embeddable classes are Embeddable { AccessType access() default PROPERTY; April 25, 2008 MTA with Java EE / Stateless Session Beans 30

31 Example Class Address: import public class Address implements Serializable { private String street; // other instance variables... public Address() { // no-arg constructor required public Address(String street, String place, String country) { // initialize instance variables... // public getters // (setters can be omitted if access type // of enclosing entity is FIELD) April 25, 2008 MTA with Java EE / Stateless Session Beans 31

32 Embeddable Class: How It Is Used You use and embeddable class in an entity class = "EJB3_SALES_CUSTOMER") public class CustomerEntity implements Customer, private int id; private String private Address address; public Customer() { // public no-arg constructor public Customer(String firstname, String lastname, Address address) {... this.address = address; // getters and setters as before, and... (next slide) April 25, 2008 MTA with Java EE / Stateless Session Beans 32

33 Embeddable Class: How It Is Used (cont'd)... public Address getaddress() { return this.address; public void setaddress(address address) { this.address = address; By default the fields of the Address class will be mapped onto columns of the Customer bean table April 25, 2008 MTA with Java EE / Stateless Session Beans 33

34 References [EJB] JSR 220: Enterprise JavaBeans, Version 3.0 EJB 3.0 Simplified API [EJB Core] JSR 220: Enterprise JavaBeans, Version 3.0 EJB Core Contracts and Requirements [EJB Persistence] JSR 220: Enterprise JavaBeansTM,Version 3.0 Java Persistence API April 25, 2008 MTA with Java EE / Stateless Session Beans 34

JPA Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule

JPA Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule Berner Fachhochschule Technik und Informatik JPA Entities Course Multi Tier Business Applications with Java EE Prof. Dr. Eric Dubuis Berner Fachhochschule Biel Content Characteristics of entities Programming

More information

EJB 3 Entity Relationships

EJB 3 Entity Relationships Berner Fachhochschule Technik und Informatik EJB 3 Entity Relationships Course Multi Tier Business Applications with Java EE Prof. Dr. Eric Dubuis Berner Fachhochschule Biel Content What are relationships?

More information

EJB 3 Entity Relationships

EJB 3 Entity Relationships Berner Fachhochschule Technik und Informatik EJB 3 Entity Relationships Course Multi Tier Business Applications with Java EE Prof. Dr. Eric Dubuis Berner Fachhochschule Biel Content What are relationships?

More information

Introduction to JPA. Fabio Falcinelli

Introduction to JPA. Fabio Falcinelli Introduction to JPA Fabio Falcinelli Me, myself and I Several years experience in active enterprise development I love to design and develop web and standalone applications using Python Java C JavaScript

More information

Module 8 The Java Persistence API

Module 8 The Java Persistence API Module 8 The Java Persistence API Objectives Describe the role of the Java Persistence API (JPA) in a Java EE application Describe the basics of Object Relational Mapping Describe the elements and environment

More information

Entities are classes that need to be persisted, usually in a relational database. In this chapter we cover the following topics:

Entities are classes that need to be persisted, usually in a relational database. In this chapter we cover the following topics: Entities are classes that need to be persisted, usually in a relational database. In this chapter we cover the following topics: EJB 3 entities Java persistence API Mapping an entity to a database table

More information

Topics in Enterprise Information Management

Topics in Enterprise Information Management Topics in Enterprise Information Management Dr. Ilan Kirsh JPA Basics Object Database and ORM Standards and Products ODMG 1.0, 2.0, 3.0 TopLink, CocoBase, Castor, Hibernate,... EJB 1.0, EJB 2.0: Entity

More information

Java EE Architecture, Part Three. Java EE architecture, part three 1(69)

Java EE Architecture, Part Three. Java EE architecture, part three 1(69) Java EE Architecture, Part Three Java EE architecture, part three 1(69) Content Requirements on the Integration layer The Database Access Object, DAO Pattern Frameworks for the Integration layer Java EE

More information

Stateful Session Beans

Stateful Session Beans Berner Fachhochschule Technik und Informatik Stateful Session Beans Course Multi Tier Business Applications with Java EE Prof. Dr. Eric Dubuis Berner Fachhochschule Biel Content Characteristics of stateful

More information

Table of Contents EJB 3.1 and JPA 2

Table of Contents EJB 3.1 and JPA 2 Table of Contents EJB 3.1 and JPA 2 Enterprise JavaBeans and the Java Persistence API 1 Workshop Overview 2 Workshop Objectives 3 Workshop Agenda 4 Course Prerequisites 5 Labs 6 Session 1: Introduction

More information

JPA. Java persistence API

JPA. Java persistence API JPA Java persistence API JPA Entity classes JPA Entity classes are user defined classes whose instances can be stored in a database. JPA Persistable Types The term persistable types refers to data types

More information

Injection Of Entitymanager

Injection Of Entitymanager Injection Of Entitymanager Example injection-of-entitymanager can be browsed at https://github.com/apache/tomee/tree/master/examples/injection-ofentitymanager This example shows use of @PersistenceContext

More information

Introduction to Session beans. EJB - continued

Introduction to Session beans. EJB - continued Introduction to Session beans EJB - continued Local Interface /** * This is the HelloBean local interface. * * This interface is what local clients operate * on when they interact with EJB local objects.

More information

Lightweight J2EE Framework

Lightweight J2EE Framework Lightweight J2EE Framework Struts, spring, hibernate Software System Design Zhu Hongjun Session 4: Hibernate DAO Refresher in Enterprise Application Architectures Traditional Persistence and Hibernate

More information

Shale and the Java Persistence Architecture. Craig McClanahan Gary Van Matre. ApacheCon US 2006 Austin, TX

Shale and the Java Persistence Architecture. Craig McClanahan Gary Van Matre. ApacheCon US 2006 Austin, TX Shale and the Java Persistence Architecture Craig McClanahan Gary Van Matre ApacheCon US 2006 Austin, TX 1 Agenda The Apache Shale Framework Java Persistence Architecture Design Patterns for Combining

More information

Dali Java Persistence Tools

Dali Java Persistence Tools Dali Java Persistence Tools User Guide Release 3.2 September 2012 Dali Java Persistence Tools User Guide Release 3.2 Copyright 2011, 2012, Oracle and/or its affiliates. All rights reserved. The Eclipse

More information

Final Release. Sun Microsystems. JSR 220: Enterprise JavaBeans TM,Version 3.0. Java Persistence API. EJB 3.0 Expert Group

Final Release. Sun Microsystems. JSR 220: Enterprise JavaBeans TM,Version 3.0. Java Persistence API. EJB 3.0 Expert Group microsystems Sun Microsystems JSR 220: Enterprise JavaBeans TM,Version 3.0 Java Persistence API EJB 3.0 Expert Group Specification Lead: Linda DeMichiel, Sun Microsystems Michael Keith, Oracle Corporation

More information

Practice Test. Oracle 1z Java Enterprise Edition 5 Business Component Developer Certified Professional Upgrade Exam. Version: 14.

Practice Test. Oracle 1z Java Enterprise Edition 5 Business Component Developer Certified Professional Upgrade Exam. Version: 14. Oracle 1z0-861 Java Enterprise Edition 5 Business Component Developer Certified Professional Upgrade Exam Practice Test Version: 14.22 QUESTION NO: 1 A developer wants to create a business interface for

More information

Chapter 1 Introducing EJB 1. What is Java EE Introduction to EJB...5 Need of EJB...6 Types of Enterprise Beans...7

Chapter 1 Introducing EJB 1. What is Java EE Introduction to EJB...5 Need of EJB...6 Types of Enterprise Beans...7 CONTENTS Chapter 1 Introducing EJB 1 What is Java EE 5...2 Java EE 5 Components... 2 Java EE 5 Clients... 4 Java EE 5 Containers...4 Introduction to EJB...5 Need of EJB...6 Types of Enterprise Beans...7

More information

Java EE Architecture, Part Three. Java EE architecture, part three 1(57)

Java EE Architecture, Part Three. Java EE architecture, part three 1(57) Java EE Architecture, Part Three Java EE architecture, part three 1(57) Content Requirements on the Integration layer The Database Access Object, DAO Pattern Frameworks for the Integration layer Java EE

More information

Enterprise JavaBeans, Version 3 (EJB3) Programming

Enterprise JavaBeans, Version 3 (EJB3) Programming Enterprise JavaBeans, Version 3 (EJB3) Programming Description Audience This course teaches developers how to write Java Enterprise Edition (JEE) applications that use Enterprise JavaBeans, version 3.

More information

Fast Track to EJB 3.0 and the JPA Using JBoss

Fast Track to EJB 3.0 and the JPA Using JBoss Fast Track to EJB 3.0 and the JPA Using JBoss The Enterprise JavaBeans 3.0 specification is a deep overhaul of the EJB specification that is intended to improve the EJB architecture by reducing its complexity

More information

SUN Sun Cert Bus Component Developer Java EE Platform 5, Upgrade. Download Full Version :

SUN Sun Cert Bus Component Developer Java EE Platform 5, Upgrade. Download Full Version : SUN 310-092 Sun Cert Bus Component Developer Java EE Platform 5, Upgrade Download Full Version : https://killexams.com/pass4sure/exam-detail/310-092 D. A javax.ejb.nosuchentityexception is thrown. Answer:

More information

5/2/2017. The entity manager. The entity manager. Entities lifecycle and manipulation

5/2/2017. The entity manager. The entity manager. Entities lifecycle and manipulation Entities lifecycle and manipulation Software Architectures and Methodologies - JPA: Entities lifecycle and manipulation Dipartimento di Ingegneria dell'informazione Laboratorio Tecnologie del Software

More information

Apache OpenJPA User's Guide

Apache OpenJPA User's Guide Apache OpenJPA User's Guide Apache OpenJPA User's Guide 1. Introduction 1 1. OpenJPA.. 3 1.1. About This Document. 3 2. Java Persistence API 4 1. Introduction. 9 1.1. Intended Audience 9 1.2. Lightweight

More information

Java Persistence API (JPA) Entities

Java Persistence API (JPA) Entities Java Persistence API (JPA) Entities JPA Entities JPA Entity is simple (POJO) Java class satisfying requirements of JavaBeans specification Setters and getters must conform to strict form Every entity must

More information

Java EE 7: Back-End Server Application Development

Java EE 7: Back-End Server Application Development Oracle University Contact Us: Local: 0845 777 7 711 Intl: +44 845 777 7 711 Java EE 7: Back-End Server Application Development Duration: 5 Days What you will learn The Java EE 7: Back-End Server Application

More information

Dali Java Persistence Tools. User Guide Release for Eclipse

Dali Java Persistence Tools. User Guide Release for Eclipse Dali Java Persistence Tools User Guide Release 1.0.0 for Eclipse May 2007 Dali Java Persistence Tools User Guide Copyright 2006, 2007 Oracle. All rights reserved. The Eclipse Foundation makes available

More information

Developing Applications with Java EE 6 on WebLogic Server 12c

Developing Applications with Java EE 6 on WebLogic Server 12c Developing Applications with Java EE 6 on WebLogic Server 12c Duration: 5 Days What you will learn The Developing Applications with Java EE 6 on WebLogic Server 12c course teaches you the skills you need

More information

The Good, the Bad and the Ugly

The Good, the Bad and the Ugly The Good, the Bad and the Ugly 2 years with Java Persistence API Björn Beskow bjorn.beskow@callistaenterprise.se www.callistaenterprise.se Agenda The Good Wow! Transparency! The Bad Not that transparent

More information

Unit 6 Hibernate. List the advantages of hibernate over JDBC

Unit 6 Hibernate. List the advantages of hibernate over JDBC Q1. What is Hibernate? List the advantages of hibernate over JDBC. Ans. Hibernate is used convert object data in JAVA to relational database tables. It is an open source Object-Relational Mapping (ORM)

More information

Webservice Inheritance

Webservice Inheritance Webservice Inheritance Example webservice-inheritance can be browsed at https://github.com/apache/tomee/tree/master/examples/webservice-inheritance Help us document this example! Click the blue pencil

More information

1Z Oracle. Java Enterprise Edition 5 Business Component Developer Certified Professional Upgrade

1Z Oracle. Java Enterprise Edition 5 Business Component Developer Certified Professional Upgrade Oracle 1Z0-861 Java Enterprise Edition 5 Business Component Developer Certified Professional Upgrade Download Full Version : https://killexams.com/pass4sure/exam-detail/1z0-861 A. The Version attribute

More information

Object-Relational Mapping is NOT serialization! You can perform queries on each field!

Object-Relational Mapping is NOT serialization! You can perform queries on each field! ORM Object-Relational Mapping is NOT serialization! You can perform queries on each field! Using hibernate stand-alone http://www.hibernatetutorial.com/ Introduction to Entities The Sun Java Data Objects

More information

Architecture overview

Architecture overview JPA MARTIN MUDRA Architecture overview API API API API Business logic Business logic Business logic Business logic Data layer Data layer Data layer Data layer Database JPA Java Persistence API Application

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 02: Using Objects MOUNA KACEM mouna@cs.wisc.edu Fall 2018 Using Objects 2 Introduction to Object Oriented Programming Paradigm Objects and References Memory Management

More information

Session 13. Reading. A/SettingUpJPA.htm JPA Best Practices

Session 13. Reading.  A/SettingUpJPA.htm JPA Best Practices Session 13 DB Persistence (JPA) Reading Reading Java EE 7 Tutorial chapters 37-39 NetBeans/Derby Tutorial www.oracle.com/webfolder/technetwork/tutorials/obe/java/settingupjp A/SettingUpJPA.htm JPA Best

More information

WHAT IS EJB. Security. life cycle management.

WHAT IS EJB. Security. life cycle management. EJB WHAT IS EJB EJB is an acronym for enterprise java bean. It is a specification provided by Sun Microsystems to develop secured, robust and scalable distributed applications. To run EJB application,

More information

TP 6 des architectures logicielles Séance 6 : Architecture n-tiers avec du JPA avec plusieurs entités. 1 Préparation de l environnement Eclipse

TP 6 des architectures logicielles Séance 6 : Architecture n-tiers avec du JPA avec plusieurs entités. 1 Préparation de l environnement Eclipse TP 6 des architectures logicielles Séance 6 : Architecture n-tiers avec du JPA avec plusieurs entités 1 Préparation de l environnement Eclipse 1. Environment Used JDK 7 (Java SE 7) JPA 2.0 Eclipse MySQL

More information

foreword to the first edition preface xxi acknowledgments xxiii about this book xxv about the cover illustration

foreword to the first edition preface xxi acknowledgments xxiii about this book xxv about the cover illustration contents foreword to the first edition preface xxi acknowledgments xxiii about this book xxv about the cover illustration xix xxxii PART 1 GETTING STARTED WITH ORM...1 1 2 Understanding object/relational

More information

Introduction to Java Enterprise Edition For Database Application Developer

Introduction to Java Enterprise Edition For Database Application Developer CMP 420/758 Introduction to Java Enterprise Edition For Database Application Developer Department of Mathematics and Computer Science Lehman College, the CUNY 1 Java Enterprise Edition Developers today

More information

Dali Java Persistence Tools. User Guide Release 2.0 for Eclipse

Dali Java Persistence Tools. User Guide Release 2.0 for Eclipse Dali Java Persistence Tools User Guide Release 2.0 for Eclipse May 2008 Dali Java Persistence Tools User Guide Copyright 2006, 2008 Oracle. All rights reserved. The Eclipse Foundation makes available all

More information

Pro JPA 2. Mastering the Java Persistence API. Apress* Mike Keith and Merrick Schnicariol

Pro JPA 2. Mastering the Java Persistence API. Apress* Mike Keith and Merrick Schnicariol Pro JPA 2 Mastering the Java Persistence API Mike Keith and Merrick Schnicariol Apress* Gootents at a Glance g V Contents... ; v Foreword _ ^ Afooyt the Author XXj About the Technical Reviewer.. *....

More information

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Web Application Development Using JEE, Enterprise JavaBeans and JPA Web Application Development Using JEE, Enterprise Java and JPA Duration: 5 days Price: $2795 *California residents and government employees call for pricing. Discounts: We offer multiple discount options.

More information

object/relational persistence What is persistence? 5

object/relational persistence What is persistence? 5 contents foreword to the revised edition xix foreword to the first edition xxi preface to the revised edition xxiii preface to the first edition xxv acknowledgments xxviii about this book xxix about the

More information

Deployment. See Packaging and deployment processes

Deployment. See Packaging and deployment processes Index A Address instance, 85 Aggregate average response time (AART), 282 Application assembler, deployment roles external requirements conflict and redundant, 343 dependencies, 341 references, 341 342

More information

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Web Application Development Using JEE, Enterprise JavaBeans and JPA Web Application Development Using JEE, Enterprise Java and JPA Duration: 35 hours Price: $750 Delivery Option: Attend training via an on-demand, self-paced platform paired with personal instructor facilitation.

More information

Courses For Event Java Advanced Summer Training 2018

Courses For Event Java Advanced Summer Training 2018 Courses For Event Java Advanced Summer Training 2018 Java Fundamentals Oracle Java SE 8 Advanced Java Training Java Advanced Expert Edition Topics For Java Fundamentals Variables Data Types Operators Part

More information

Exploring EJB3 With JBoss Application Server Part 6.2

Exploring EJB3 With JBoss Application Server Part 6.2 By Swaminathan Bhaskar 01/24/2009 Exploring EJB3 With JBoss Application Server Part 6.2 In this part, we will continue to explore Entity Beans Using Java Persistence API (JPA). Thus far, we have seen examples

More information

Developing EJB Applications with Eclipse

Developing EJB Applications with Eclipse Developing EJB Applications with Eclipse Martin Heinemann martin.heinemann@tudor.lu Linuxdays.lu 2007 Februray 2007 Abstract This paper is the accompanying documentation for the Enterprise Java Beans/Eclipse

More information

CO Java EE 6: Develop Database Applications with JPA

CO Java EE 6: Develop Database Applications with JPA CO-77746 Java EE 6: Develop Database Applications with JPA Summary Duration 4 Days Audience Database Developers, Java EE Developers Level Professional Technology Java EE 6 Delivery Method Instructor-led

More information

Middleware for Heterogeneous and Distributed Information Systems Sample Solution Exercise Sheet 5

Middleware for Heterogeneous and Distributed Information Systems Sample Solution Exercise Sheet 5 AG Heterogene Informationssysteme Prof. Dr.-Ing. Stefan Deßloch Fachbereich Informatik Technische Universität Kaiserslautern Middleware for Heterogeneous and Distributed Information Systems Sample Solution

More information

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module Java Platform, Enterprise Edition 5 (Java EE 5) Core Java EE Java EE 5 Platform Overview Java EE Platform Distributed Multi tiered Applications Java EE Web & Business Components Java EE Containers services

More information

"Charting the Course... Mastering EJB 3.0 Applications. Course Summary

Charting the Course... Mastering EJB 3.0 Applications. Course Summary Course Summary Description Our training is technology centric. Although a specific application server product will be used throughout the course, the comprehensive labs and lessons geared towards teaching

More information

Dynamic DAO Implementation

Dynamic DAO Implementation Dynamic DAO Implementation Example dynamic-dao-implementation can be browsed at https://github.com/apache/tomee/tree/master/examples/dynamic-daoimplementation Many aspects of Data Access Objects (DAOs)

More information

Quick Reference. This appendix serves as a reference to those who may not have access to online Javadoc or. Metadata Reference APPENDIX

Quick Reference. This appendix serves as a reference to those who may not have access to online Javadoc or. Metadata Reference APPENDIX APPENDIX Quick Reference This appendix serves as a reference to those who may not have access to online Javadoc or who just can t otherwise tear themselves away from this book. The mapping annotations

More information

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

Java- EE Web Application Development with Enterprise JavaBeans and Web Services Java- EE Web Application Development with Enterprise JavaBeans and Web Services Duration:60 HOURS Price: INR 8000 SAVE NOW! INR 7000 until December 1, 2011 Students Will Learn How to write Session, Message-Driven

More information

Apache OpenJPA User's Guide

Apache OpenJPA User's Guide Apache OpenJPA User's Guide Apache OpenJPA User's Guide 1. Introduction 1 1. OpenJPA.. 3 1.1. About This Document. 3 2. Java Persistence API 4 1. Introduction. 9 1.1. Intended Audience 9 1.2. Lightweight

More information

Java EE / EJB Security

Java EE / EJB Security Berner Fachhochschule Technik und Informatik Java EE / EJB Security Course Multi Tier Business Applications with Java EE Prof. Dr. Eric Dubuis Berner Fachhochschule Biel Ambition Standard Security Modells

More information

Java EE 6: Develop Business Components with JMS & EJBs

Java EE 6: Develop Business Components with JMS & EJBs Oracle University Contact Us: + 38516306373 Java EE 6: Develop Business Components with JMS & EJBs Duration: 4 Days What you will learn This Java EE 6: Develop Business Components with JMS & EJBs training

More information

Entity LifeCycle Callback Methods Srikanth Technologies Page : 1

Entity LifeCycle Callback Methods Srikanth Technologies Page : 1 Entity LifeCycle Callback Methods Srikanth Technologies Page : 1 Entity LifeCycle Callback methods A method may be designated as a lifecycle callback method to receive notification of entity lifecycle

More information

Java Persistence API. Patrick Linskey EJB Team Lead BEA Systems Oracle

Java Persistence API. Patrick Linskey EJB Team Lead BEA Systems Oracle Java Persistence API Patrick Linskey EJB Team Lead BEA Systems Oracle plinskey@bea.com Patrick Linskey EJB Team Lead at BEA JPA 1, 2 EG Member Agenda JPA Basics What s New ORM Configuration APIs Queries

More information

Exam Questions 1Z0-895

Exam Questions 1Z0-895 Exam Questions 1Z0-895 Java Platform, Enterprise Edition 6 Enterprise JavaBeans Developer Certified Expert Exam https://www.2passeasy.com/dumps/1z0-895/ QUESTION NO: 1 A developer needs to deliver a large-scale

More information

Exploring EJB3 With JBoss Application Server Part 6.3

Exploring EJB3 With JBoss Application Server Part 6.3 By Swaminathan Bhaskar 02/07/2009 Exploring EJB3 With JBoss Application Server Part 6.3 In this part, we will continue to explore Entity Beans Using Java Persistence API (JPA). In the previous part, we

More information

Seam 3. Pete Muir JBoss, a Division of Red Hat

Seam 3. Pete Muir JBoss, a Division of Red Hat Seam 3 Pete Muir JBoss, a Division of Red Hat Road Map Introduction Java EE 6 Java Contexts and Dependency Injection Seam 3 Mission Statement To provide a fully integrated development platform for building

More information

JPA and CDI JPA and EJB

JPA and CDI JPA and EJB JPA and CDI JPA and EJB Concepts: Connection Pool, Data Source, Persistence Unit Connection pool DB connection store: making a new connection is expensive, therefor some number of connections are being

More information

Enterprise JavaBeans 3.1

Enterprise JavaBeans 3.1 SIXTH EDITION Enterprise JavaBeans 3.1 Andrew Lee Rubinger and Bill Burke O'REILLY* Beijing Cambridge Farnham Kbln Sebastopol Tokyo Table of Contents Preface xv Part I. Why Enterprise JavaBeans? 1. Introduction

More information

Oracle - Developing Applications for the Java EE 7 Platform Ed 1 (Training On Demand)

Oracle - Developing Applications for the Java EE 7 Platform Ed 1 (Training On Demand) Oracle - Developing Applications for the Java EE 7 Platform Ed 1 (Training On Demand) Code: URL: D101074GC10 View Online The Developing Applications for the Java EE 7 Platform training teaches you how

More information

Java SE7 Fundamentals

Java SE7 Fundamentals Java SE7 Fundamentals Introducing the Java Technology Relating Java with other languages Showing how to download, install, and configure the Java environment on a Windows system. Describing the various

More information

Java J Course Outline

Java J Course Outline JAVA EE - J2SE - CORE JAVA After all having a lot number of programming languages. Why JAVA; yet another language!!! AND NOW WHY ONLY JAVA??? CHAPTER 1: INTRODUCTION What is Java? History Versioning The

More information

(800) Toll Free (804) Fax Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days

(800) Toll Free (804) Fax   Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days Course Description This course introduces the Java programming language and how to develop Java applications using Eclipse 3.0. Students learn the syntax of the Java programming language, object-oriented

More information

New Features in EJB 3.1

New Features in EJB 3.1 New Features in EJB 3.1 Sangeetha S E-Commerce Research Labs, Infosys Technologies Limited 2010 Infosys Technologies Limited Agenda New Features in EJB 3.1 No Interface View EJB Components in WAR Singleton

More information

WA1278 Introduction to Java Using Eclipse

WA1278 Introduction to Java Using Eclipse Lincoln Land Community College Capital City Training Center 130 West Mason Springfield, IL 62702 217-782-7436 www.llcc.edu/cctc WA1278 Introduction to Java Using Eclipse This course introduces the Java

More information

Java Enterprise Edition

Java Enterprise Edition Java Enterprise Edition The Big Problem Enterprise Architecture: Critical, large-scale systems Performance Millions of requests per day Concurrency Thousands of users Transactions Large amounts of data

More information

Working with the Java Pages Feature. PegaRULES ProcessCommander Versions 5.1 and 5.2

Working with the Java Pages Feature. PegaRULES ProcessCommander Versions 5.1 and 5.2 Working with the Java Pages Feature PegaRULES ProcessCommander Versions 5.1 and 5.2 Copyright 2006 Pegasystems Inc., Cambridge, MA All rights reserved. This document and the software describe products

More information

JPA The New Enterprise Persistence Standard

JPA The New Enterprise Persistence Standard JPA The New Enterprise Persistence Standard Mike Keith michael.keith@oracle.com http://otn.oracle.com/ejb3 About Me Co-spec Lead of EJB 3.0 (JSR 220) Java EE 5 (JSR 244) expert group member Co-author Pro

More information

The 1st Java professional open source Convention Israel 2006

The 1st Java professional open source Convention Israel 2006 The 1st Java professional open source Convention Israel 2006 The Next Generation of EJB Development Frederic Simon AlphaCSP Agenda Standards, Open Source & EJB 3.0 Tiger (Java 5) & JEE What is EJB 3.0

More information

Oracle EXAM - 1Z Java EE 6 Enterprise JavaBeans Developer Certified Expert Exam. Buy Full Product.

Oracle EXAM - 1Z Java EE 6 Enterprise JavaBeans Developer Certified Expert Exam. Buy Full Product. Oracle EXAM - 1Z0-895 Java EE 6 Enterprise JavaBeans Developer Certified Expert Exam Buy Full Product http://www.examskey.com/1z0-895.html Examskey Oracle 1Z0-895 exam demo product is here for you to test

More information

CMP 436/774. Introduction to Java Enterprise Edition. Java Enterprise Edition

CMP 436/774. Introduction to Java Enterprise Edition. Java Enterprise Edition CMP 436/774 Introduction to Java Enterprise Edition Fall 2013 Department of Mathematics and Computer Science Lehman College, CUNY 1 Java Enterprise Edition Developers today increasingly recognize the need

More information

1Z Java SE 5 and 6, Certified Associate Exam Summary Syllabus Questions

1Z Java SE 5 and 6, Certified Associate Exam Summary Syllabus Questions 1Z0-850 Java SE 5 and 6, Certified Associate Exam Summary Syllabus Questions Table of Contents Introduction to 1Z0-850 Exam on Java SE 5 and 6, Certified Associate... 2 Oracle 1Z0-850 Certification Details:...

More information

Communication Software Exam 5º Ingeniero de Telecomunicación January 26th Name:

Communication Software Exam 5º Ingeniero de Telecomunicación January 26th Name: Duration: Marks: 2.5 hours (+ half an hour for those students sitting part III) 8 points (+ 1 point for part III, for those students sitting this part) Part II: problems Duration: 2 hours Marks: 4 points

More information

jar command Java Archive inherits from tar : Tape Archive commands: jar cvf filename jar tvf filename jar xvf filename java jar filename.

jar command Java Archive inherits from tar : Tape Archive commands: jar cvf filename jar tvf filename jar xvf filename java jar filename. jar & jar files jar command Java Archive inherits from tar : Tape Archive commands: jar cvf filename jar tvf filename jar xvf filename java jar filename.jar jar file A JAR file can contain Java class files,

More information

Java EE Architecture, Part Two. Java EE architecture, part two 1

Java EE Architecture, Part Two. Java EE architecture, part two 1 Java EE Architecture, Part Two Java EE architecture, part two 1 Content Requirements on the Business layer Framework Independent Patterns Transactions Frameworks for the Business layer Java EE architecture,

More information

A COMPONENT BASED ONLINE ORDERING SYSTEM USING ENTERPRISE JAVABEANS 3.0

A COMPONENT BASED ONLINE ORDERING SYSTEM USING ENTERPRISE JAVABEANS 3.0 A COMPONENT BASED ONLINE ORDERING SYSTEM USING ENTERPRISE JAVABEANS 3.0 AUTHOR: JAMES OSBORNE SUPERVISOR: DR. KUNG KIU LAU 2 MAY 2007 ABSTRACT Title: A Component Based Online Ordering System Using Enterprise

More information

find() method, 178 forclass() method, 162 getcurrentsession(), 16 getexecutablecriteria() method, 162 get() method, 17, 177 getreference() method, 178

find() method, 178 forclass() method, 162 getcurrentsession(), 16 getexecutablecriteria() method, 162 get() method, 17, 177 getreference() method, 178 Index A accessor() method, 58 Address entity, 91, 100 @AllArgsConstructor annotations, 106 107 ArrayList collection, 110 Arrays, 116 Associated objects createalias() method, 165 166 createcriteria() method,

More information

Index. setmaxresults() method, 169 sorting, 170 SQL DISTINCT query, 171 uniqueresult() method, 169

Index. setmaxresults() method, 169 sorting, 170 SQL DISTINCT query, 171 uniqueresult() method, 169 Index A Annotations Hibernate mappings, 81, 195 Hibernate-specific persistence annotations Immutable annotation, 109 natural ID, 110 Hibernate XML configuration file, 108 JPA 2 persistence (see JPA 2 persistence

More information

What data persistence means? We manipulate data (represented as object state) that need to be stored

What data persistence means? We manipulate data (represented as object state) that need to be stored 1 Data Persistence What data persistence means? We manipulate data (represented as object state) that need to be stored persistently to survive a single run of the application queriably to be able to retrieve/access

More information

CS506 Web Design & Development Final Term Solved MCQs with Reference

CS506 Web Design & Development Final Term Solved MCQs with Reference with Reference I am student in MCS (Virtual University of Pakistan). All the MCQs are solved by me. I followed the Moaaz pattern in Writing and Layout this document. Because many students are familiar

More information

Selecting a Primary Key - 2

Selecting a Primary Key - 2 Software Architectures and Methodologies A.A 2016/17 Java Persistence API Mapping, Inheritance and Performance Primary Key Dipartimento di Ingegneria dell'informazione Laboratorio Tecnologie del Software

More information

Deccansoft Software Services. J2EE Syllabus

Deccansoft Software Services. J2EE Syllabus Overview: Java is a language and J2EE is a platform which implements java language. J2EE standard for Java 2 Enterprise Edition. Core Java and advanced java are the standard editions of java whereas J2EE

More information

Grails Seminar 11/12/09. Groovy And Grails. An Overview

Grails Seminar 11/12/09. Groovy And Grails. An Overview Grails Seminar 11/12/09 Groovy And Grails An Overview Groovy What Is Groovy? Groovy... Is A Dynamic Language For The Java Virtual Machine (JVM) Takes inspiration from Smalltalk, Python and Ruby (etc...)

More information

Application Servers G Session 11 - Sub-Topic 2 Using Enterprise JavaBeans. Dr. Jean-Claude Franchitti

Application Servers G Session 11 - Sub-Topic 2 Using Enterprise JavaBeans. Dr. Jean-Claude Franchitti Application Servers G22.3033-011 Session 11 - Sub-Topic 2 Using Enterprise JavaBeans Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences

More information

EJB 3.0 Puzzlers. Mike Keith, Oracle Corp. Colorado Software Summit: October 21 26, 2007

EJB 3.0 Puzzlers. Mike Keith, Oracle Corp.   Colorado Software Summit: October 21 26, 2007 EJB 3.0 Puzzlers Mike Keith, Oracle Corp. michael.keith@oracle.com http://otn.oracle.com/ejb3 Slide 1 About Me Co-spec Lead of EJB 3.0 (JSR 220) and Java EE 5 (JSR 244) expert group member Currently working

More information

Information systems modelling UML and service description languages

Information systems modelling UML and service description languages Internet Engineering Tomasz Babczyński, Zofia Kruczkiewicz Tomasz Kubik Information systems modelling UML and service description languages Laboratory 3 Examplary multitiered Information System (Java EE

More information

On Polymorphism and the Open-Closed Principle

On Polymorphism and the Open-Closed Principle Berner Fachhochschule Engineering and Information Technology On Polymorphism and the Open-Closed Principle Prof. Dr. Eric Dubuis Berner Fachhochschule, Engineering and Information Technology @ Biel Course

More information

Simple Component Writer's Guide

Simple Component Writer's Guide Simple Component Writer's Guide Note that most of the following also applies to writing ordinary libraries for Simple. The preferred language to write Simple components is Java, although it should be possible

More information

This course is intended for Java programmers who wish to write programs using many of the advanced Java features.

This course is intended for Java programmers who wish to write programs using many of the advanced Java features. COURSE DESCRIPTION: Advanced Java is a comprehensive study of many advanced Java topics. These include assertions, collection classes, searching and sorting, regular expressions, logging, bit manipulation,

More information

JSR 299: Web Beans. Web Beans Expert Group. Version: Public Review

JSR 299: Web Beans. Web Beans Expert Group. Version: Public Review JSR 299: Web Beans Web Beans Expert Group Version: Public Review Table of Contents 1. Architecture... 1 1.1. Contracts... 1 1.2. Supported environments... 1 1.3. Relationship to other specifications...

More information

Testing Transactions BMT

Testing Transactions BMT Testing Transactions BMT Example testing-transactions-bmt can be browsed at https://github.com/apache/tomee/tree/master/examples/testing-transactions-bmt Shows how to begin, commit and rollback transactions

More information

Introduction... xv SECTION 1: DEVELOPING DESKTOP APPLICATIONS USING JAVA Chapter 1: Getting Started with Java... 1

Introduction... xv SECTION 1: DEVELOPING DESKTOP APPLICATIONS USING JAVA Chapter 1: Getting Started with Java... 1 Introduction... xv SECTION 1: DEVELOPING DESKTOP APPLICATIONS USING JAVA Chapter 1: Getting Started with Java... 1 Introducing Object Oriented Programming... 2 Explaining OOP concepts... 2 Objects...3

More information