Oracle TopLink

Last updated

Oracle TopLink is a mapping and persistence framework for Java developers. TopLink is produced by Oracle and is a part of Oracle's OracleAS, WebLogic, and OC4J servers. [1] It is an object-persistence and object-transformation framework. TopLink provides development tools and run-time functionalities that ease the development process and help increase functionality. Persistent object-oriented data is stored in relational databases which helps build high-performance applications. Storing data in either XML (Extensible Markup Language) or relational databases is made possible by transforming it from object-oriented data.

Contents

A rich user-interface is possible on TopLink with the help of TopLink Mapping Workbench. This Mapping Workbench makes it possible to carry out the following with ease.

Oracle's JDeveloper IDE provides easy integration of these functionalities provided by the Mapping Workbench.

With the use of TopLink, users can stay more focused on their primary cause and let TopLink handle the integration of persistence and object transformation into their application. Designing, implementing and deploying process is accelerated as TopLink supports a variety of data sources and formats such as Relational database, Object-relational database, Enterprise information system (EIS), XML and many others.

Oracle TopLink
Developer(s) Oracle Corporation
Stable release
Oracle TopLink 12c (12.1.3)
Written in Java
Operating system Cross-platform
Platform Java Virtual Machine
License Oracle License
Website www.oracle.com/technetwork/middleware/toplink/overview/index.html

History

Toplink was originally developed by The Object People in Smalltalk. It was ported to Java in 1996-1998 and called "TopLink for Java". In 2002,TopLink was acquired by Oracle Corporation and was developed under the Oracle Fusion Middleware product. The TopLink code was donated to the Eclipse Foundation and the EclipseLink project was born in 2007. [1] The EclipseLink now provides the functionality of TopLink. Sun Microsystems selected EclipseLink in March 2008, as the implementation for the JPA 2.0, JSR 317 reference. A number of versions of TopLink have been released since and the latest version 12c (12.1.3) is available for free Download. [2]

Key Features

Key Components

The runtime component of TopLink is provided by the EclipseLink Core. This API provides direct access to the runtime, which is embedded into the application. Persistence behavior is enabled by making application calls that invoke EclipseLink API to perform these functionalities which provides safe access to shared databases. [3]

Import the following class to use extended functionality of EclipseLink.

importorg.eclipse.persistence.*

Object-Relational(JPA 2.0) Component

The binding of Java classes to XML schemas is possible with the help of Object-XML, which is an EclipseLink component. By implementing JAXB, mapping information is provided through annotations. It also provides manipulation of XML. [3]

SDO Component

The Service Data Objects (SDO) provides with the use of SDO API, use dynamic objects to customize and manipulate XML, use of static data objects and conversion of XML Schema. [3]

Database Web Services Component

Database Web Services (DBWS) facilitates access to relational databases with the help of web service. A database access can be made without the need to write a Java code. The XML SOAP Messages and the databases are connected by the runtime component of DBWS which uses EclipseLink. [3]

TopLink Grid is an integration mechanism that provides connection between Oracle Coherence and EclipseLink. An application generally interacts with the relational database, which is its primary database. But with TopLink the application can store data on the Coherence grid called as JPA on the grid. [4]

TopLink Grid functionality can be used only if the user has license for Oracle Coherence. This functionality is provided by:

toplink-grid.jar

To get support for TopLink Grid and EclipseLink, users also need to import the following package of classes.

org.eclipse.coherence.*

Database operations like Insert, Update and Delete can also be performed in TopLink. The changes made to the database are reflected in the Oracle Coherence cache. In Java Persistence API, an entity is a persistence class. Using TopLink, a number of performance features for writing large amounts of data can be implemented. Batch writing, stored procedure support, parameter binding, statement ordering and other features are offered to satisfy database constraints.

The basic operations are

Insert

The EntityManager method persist(Object entity) is used to add an instance and marks it for insertion into the database.

entityManager.getTransaction().begin();EmployeenewEmployee=newEmployee(5);entityManager.persist(newEmployee);entityManager.getTransaction().commit();

On completion of the transaction, the newEmployee data will be inserted into the database. [5]

Update

Updating an entity means simply reading the transaction and updating the properties of this entity. Updating the Employee LastName can be done as follows. [5]

entityManager.getTransaction().begin();EmployeeexistingEmployee=entityManager.find(Employee.class,5);existingEmployee.setLastName("NewLastName");entityManager.getTransaction().commit();

Delete

Deleting an entity is the opposite of Insertion and can be one using remove(Object entity) method of the EntityManager.

entityManager.getTransaction().begin();EmployeeexistingEmployee=entityManager.find(Employee.class,5);entityManager.remove(existingEmployee);entityManager.getTransaction().commit();

The EntityManager method flush() deletes the entity on completion of the transaction. [5]

Development Tools

Users can use most of the tools in the market and use TopLink along with it. But the following toots provide special integration with TopLink.

Supported Database Platforms

DatabaseJava Class
Apache Derby org.eclipse.persistence.platform.database.DerbyPlatform
Attunityorg.eclipse.persistence.platform.database.AttunityPlatform
dBASE org.eclipse.persistence.platform.database.DBasePlatform
Firebird org.eclipse.persistence.platform.database.FirebirdPlatform
H2 org.eclipse.persistence.platform.database.H2Platform
HyperSQLDatabase(HSQL) org.eclipse.persistence.platform.database.HSQLPlatform
IBM Cloudscape org.eclipse.persistence.platform.database.CloudscapePlatform
IBM Db2 org.eclipse.persistence.platform.database.DB2MainframePlatform
Microsoft Access org.eclipse.persistence.platform.database.AccessPlatformPlatform
Microsoft SQLServer org.eclipse.persistence.platform.database.SQLServerPlatform
MySQL org.eclipse.persistence.platform.database.MySQLPlatform

See also

Related Research Articles

<span class="mw-page-title-main">Jakarta EE</span> Set of specifications extending Java SE

Jakarta EE, formerly Java Platform, Enterprise Edition and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE with specifications for enterprise features such as distributed computing and web services. Jakarta EE applications are run on reference runtimes, which can be microservices or application servers, which handle transactions, security, scalability, concurrency and management of the components they are deploying.

Object–relational mapping in computer science is a programming technique for converting data between a relational database and the heap of an object-oriented programming language. This creates, in effect, a virtual object database that can be used from within the programming language.

<span class="mw-page-title-main">Object–relational database</span> Database management system

An object–relational database (ORD), or object–relational database management system (ORDBMS), is a database management system (DBMS) similar to a relational database, but with an object-oriented database model: objects, classes and inheritance are directly supported in database schemas and in the query language. In addition, just as with pure relational systems, it supports extension of the data model with custom data types and methods.

Java Data Objects (JDO) is a specification of Java object persistence. One of its features is a transparency of the persistence services to the domain model. JDO persistent objects are ordinary Java programming language classes (POJOs); there is no requirement for them to implement certain interfaces or extend from special classes. JDO 1.0 was developed under the Java Community Process as JSR 12. JDO 2.0 was developed under JSR 243 and was released on May 10, 2006. JDO 2.1 was completed in Feb 2008, developed by the Apache JDO project. JDO 2.2 was released in October 2008. JDO 3.0 was released in April 2010.

In software, a data access object (DAO) is a pattern that provides an abstract interface to some type of database or other persistence mechanism. By mapping application calls to the persistence layer, the DAO provides data operations without exposing database details. This isolation supports the single responsibility principle. It separates the data access the application needs, in terms of domain-specific objects and data types, from how these needs can be satisfied with a specific DBMS.

Hibernate ORM is an object–relational mapping tool for the Java programming language. It provides a framework for mapping an object-oriented domain model to a relational database. Hibernate handles object–relational impedance mismatch problems by replacing direct, persistent database accesses with high-level object handling functions.

The Spring Framework is an application framework and inversion of control container for the Java platform. The framework's core features can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform. The framework does not impose any specific programming model.. The framework has become popular in the Java community as an addition to the Enterprise JavaBeans (EJB) model. The Spring Framework is free and open source software.

Jakarta Persistence is a Jakarta EE application programming interface specification that describes the management of relational data in enterprise Java applications.

OpenJPA is an open source implementation of the Java Persistence API specification. It is an object-relational mapping (ORM) solution for the Java language, which simplifies storing objects in databases. It is open-source software distributed under the Apache License 2.0.

EclipseLink is the open source Eclipse Persistence Services Project from the Eclipse Foundation. The software provides an extensible framework that allows Java developers to interact with various data services, including databases, web services, Object XML mapping (OXM), and enterprise information systems (EIS). EclipseLink supports a number of persistence standards including:

Ebean is an object–relational mapping product written in Java. It is designed to be simpler to use and understand than JPA or JDO products.

Apache ObJectRelationalBridge (OJB) is an Object/Relational mapping tool that allows transparent persistence for Java Objects against relational databases. It was released on April 6, 2005.

JBoss Developer Studio (JBDS) is a development environment created and currently developed by JBoss and Exadel.

Oracle WebLogic Server is a Java EE application server currently developed by Oracle Corporation. Oracle acquired WebLogic Server when it purchased BEA Systems in 2008.

Apache Empire-db is a Java library that provides a high level object-oriented API for accessing relational database management systems (RDBMS) through JDBC. Apache Empire-db is open source and provided under the Apache License 2.0 from the Apache Software Foundation.

In computing, Oracle Coherence is a Java-based distributed cache and in-memory data grid. It is claimed to be intended for systems that require high availability, high scalability and low latency, particularly in cases when traditional relational database management systems provide insufficient throughput, or insufficient performance.

Canigó is the name chosen for the Java EE framework of the Generalitat de Catalunya.

The .NET Persistence API, also referred to as NPA, is a persistence and object–relational mapping (ORM) specification for the .NET framework.

References

  1. 1 2 3 "Java Persistence/TopLink - Wikibooks, open books for an open world". en.wikibooks.org. Retrieved 2016-02-07.
  2. "Oracle TopLink Software Downloads". www.oracle.com. Retrieved 2016-02-08.
  3. 1 2 3 4 "Oracle Documentation" (PDF).
  4. "Oracle® Fusion Middleware Integrating Oracle Coherence". docs.oracle.com. Retrieved 2016-02-08.
  5. 1 2 3 "TopLink JPA: How to Create, Modify and Delete an Entity". www.oracle.com. Retrieved 2016-02-08.