To implement any system using hibernate, a XML (Extensible Markup Language) mapping is
defined that specifies how the various objects will persist in the database. The XML specifies
mapping between classes and tables, properties and columns, association and foreign keys. In
this paper we primarily focus on how different association among classes should be mapped in
XML configuration file for persistence. A particular type of association should be specified in
XML configuration file using valid elements and tags provided by hibernate. Such a defined
XML document then create the valid schema, and the constraints between respective tables in
the database to implement any system. Here we present how the different types of associations
should be implemented in hibernate to have desired effect on the database. We also tested the
use cases those may violate the constraints specified by XML configuration and studied the
results
D
ata validation is
becoming
more and more
important
w
ith the ever
-
growing amount of data being
consumed a
nd transmitted by systems over the Internet. It is important to ensure that the data being sent is
valid as
it
may cont
ain entry
errors, which
may be
consumed
by different systems
causing further errors
.
XML has become the defacto standard for data transfe
r. The XML Schema Definition language (XSD) was
created to help XML
structural
validation and provide a schema for data type restrictions, however it does
not allow for more complex
situations
. In this article we
introduce a way to provide rule based XML
v
alidation
and correction
through the extension
and improve
ment of our SRML metalanguage.
We also
explore the option of
applying it in
a database as a trig
ger for CRUD
operations
allowing
more granular
data
set
validation
on an ato
mic level
allow
ing
for more
com
plex
dataset record
validation rules
Catalog-based Conversion from Relational Database into XML Schema (XSD)CSCJournals
Where we are in the age of information revolution, exchange information, and transport data effectively among various sectors of government, commercial, service and industrial, etc., the uses of a new databases model to support this trend has become very important because inability of traditional databases models to support it. eXtensible Markup Language (XML) considers a new standard model for data interchange through internet and mobiles devices networks, it has become a common language to exchange and share the data of traditional models in easy and inexpensive ways. In this research, we propose a new technique to convert the relational database contents and schema into XML schema (XSD- XML Schema Definition), the main idea of the technique is extracting relational database catalog using Structured Query Language (SQL). We follow three steps to complete the conversion process. First, extracting relation instance (actual content) and schema catalog using SQL query language, which consider the required information to implement XML document and its schema. Second, transform the actual content into XML document tree. The idea of this step is converting table columns of the relations (tables) into the elements of XML document. Third, transform schema catalog into XML schema for describing the structure of the XML document. To do so, we transform datatype of the elements and the variant data constrains such as data length, not null, check and default, moreover define primary foreign keys and the referential integrity between the tables. Overall results of the technique are very promise while the technique is very clear and does not require complex procedures that could adversely effect on the results accuracy. We performed many experiments and report their elapsed CPU times.
D
ata validation is
becoming
more and more
important
w
ith the ever
-
growing amount of data being
consumed a
nd transmitted by systems over the Internet. It is important to ensure that the data being sent is
valid as
it
may cont
ain entry
errors, which
may be
consumed
by different systems
causing further errors
.
XML has become the defacto standard for data transfe
r. The XML Schema Definition language (XSD) was
created to help XML
structural
validation and provide a schema for data type restrictions, however it does
not allow for more complex
situations
. In this article we
introduce a way to provide rule based XML
v
alidation
and correction
through the extension
and improve
ment of our SRML metalanguage.
We also
explore the option of
applying it in
a database as a trig
ger for CRUD
operations
allowing
more granular
data
set
validation
on an ato
mic level
allow
ing
for more
com
plex
dataset record
validation rules
Catalog-based Conversion from Relational Database into XML Schema (XSD)CSCJournals
Where we are in the age of information revolution, exchange information, and transport data effectively among various sectors of government, commercial, service and industrial, etc., the uses of a new databases model to support this trend has become very important because inability of traditional databases models to support it. eXtensible Markup Language (XML) considers a new standard model for data interchange through internet and mobiles devices networks, it has become a common language to exchange and share the data of traditional models in easy and inexpensive ways. In this research, we propose a new technique to convert the relational database contents and schema into XML schema (XSD- XML Schema Definition), the main idea of the technique is extracting relational database catalog using Structured Query Language (SQL). We follow three steps to complete the conversion process. First, extracting relation instance (actual content) and schema catalog using SQL query language, which consider the required information to implement XML document and its schema. Second, transform the actual content into XML document tree. The idea of this step is converting table columns of the relations (tables) into the elements of XML document. Third, transform schema catalog into XML schema for describing the structure of the XML document. To do so, we transform datatype of the elements and the variant data constrains such as data length, not null, check and default, moreover define primary foreign keys and the referential integrity between the tables. Overall results of the technique are very promise while the technique is very clear and does not require complex procedures that could adversely effect on the results accuracy. We performed many experiments and report their elapsed CPU times.
Overview of Object-Oriented Concepts Characteristics by vikas jagtapVikas Jagtap
Object-oriented data base systems are proposed as alternative to relational systems and are aimed at application domains where complex objects play a central role.
The approach is heavily influenced by object-oriented programming languages and can be understood as an attempt to add DBMS functionality to a programming language environment
ADO.NET Architecture
Data processing has traditionally relied primarily on a connection-based, two-tier model. As data
processing increasingly uses multi-tier architectures, programmers are switching to a
disconnected approach to provide better scalability for their applications.
An Introduction to Architecture of Object Oriented Database Management System and how it differs from RDBMS means Relational Database Management System
Arm based automatic control system of nano positioning stage for micromanufac...csandit
A microcontroller based control system to drive the Physik Instrumente (PI )
piezoelectric ultrasonic nano-positioning (PUN) stage for a micro-factory has been
proposed by the author. The tuning parameters of the PI Line Controller are chosen
such that the PUN stage shows optimum step response. The microcontroller i.e.
LPC2478R provides the user with the choices of operations on the 3.2” QVGA LCD
screen and the choice can be made by a 5-key joystick. The PUN stage moves in
different geometrical patterns as chosen by the user. The stage is placed in the
workspace of the Clark-MXRR,Inc. CPA-2101 femto-second laser. Different patterns
are made on the material in question. As compared to the previous works in this area,
the user is given the power for position control, real time tracking, and trajectory
planning of the actuator. The user interface has been made very easy to comprehend.
The repeatability of tasks, portability of the as- sembly, the reduction in the size of the
system , power consumption and the human involvement are the major achievements
after the inclusion of a microcontroller.
Overview of Object-Oriented Concepts Characteristics by vikas jagtapVikas Jagtap
Object-oriented data base systems are proposed as alternative to relational systems and are aimed at application domains where complex objects play a central role.
The approach is heavily influenced by object-oriented programming languages and can be understood as an attempt to add DBMS functionality to a programming language environment
ADO.NET Architecture
Data processing has traditionally relied primarily on a connection-based, two-tier model. As data
processing increasingly uses multi-tier architectures, programmers are switching to a
disconnected approach to provide better scalability for their applications.
An Introduction to Architecture of Object Oriented Database Management System and how it differs from RDBMS means Relational Database Management System
Arm based automatic control system of nano positioning stage for micromanufac...csandit
A microcontroller based control system to drive the Physik Instrumente (PI )
piezoelectric ultrasonic nano-positioning (PUN) stage for a micro-factory has been
proposed by the author. The tuning parameters of the PI Line Controller are chosen
such that the PUN stage shows optimum step response. The microcontroller i.e.
LPC2478R provides the user with the choices of operations on the 3.2” QVGA LCD
screen and the choice can be made by a 5-key joystick. The PUN stage moves in
different geometrical patterns as chosen by the user. The stage is placed in the
workspace of the Clark-MXRR,Inc. CPA-2101 femto-second laser. Different patterns
are made on the material in question. As compared to the previous works in this area,
the user is given the power for position control, real time tracking, and trajectory
planning of the actuator. The user interface has been made very easy to comprehend.
The repeatability of tasks, portability of the as- sembly, the reduction in the size of the
system , power consumption and the human involvement are the major achievements
after the inclusion of a microcontroller.
Marketing pessoal: Muito além do networkingMarcello Pepe
Empresas não fazem negócios com empresas.
Pessoas é que fazem negócios com pessoas.
Aprenda como ir além do networking, criando mais que uma rede de contatos.
JThermodynamicsCloud is software service for the chemical, or more specifically, the combustion research
domain. JThermodynamicsCloud service can be said to be an model driven application, where the ontology
is a platform independent model of the data and operational structures. The ontology, as used by the service,
has three distinct purposes: documentation, data structure definition and operational definitions. One goal of
the ontology is to place as much of the design and domain specific structures in the ontology rather than in
the application code. The application code interprets the ontology in the backend. The primary purpose of
the JThermodynamicsCloud is to perform thermdynamic calculations and manage the data needed to make
those calculations. The calculation itself is highly dependent on the varied types of molecular data found in
the database The complete service is a system with three interacting components, a user interface using
Angular, a (RESTful) backend written in JAVA (with the JENA API interpreting the ontology) and the
Google Firestore noSQL document database and Firebase storage. The service uses these three components
to make calculations for thermodynamic quantities based on molecular species structure. These different
platforms are united through the ontology.
Purpose of the data base system, data abstraction, data model, data independence, data definition
language, data manipulation language, data base manager, data base administrator, data base users,
overall structure.
ER Models, entities, mapping constrains, keys, E-R diagram, reduction E-R diagrams to tables,
generatio, aggregation, design of an E-R data base scheme.
Oracle RDBMS, architecture, kernel, system global area (SGA), data base writer, log writer, process
monitor, archiver, database files, control files, redo log files, oracle utilities.
SQL: commands and data types, data definition language commands, data manipulation commands,
data query language commands, transaction language control commands, data control language
commands.
Joins, equi-joins, non-equi-joins, self joins, other joins, aggregate functions, math functions, string
functions, group by clause, data function and concepts of null values, sub-querries, views.
PL/SQL, basics of pl/sql, data types, control structures, database access with PL/SQL, data base
connections, transaction management, data base locking, cursor management.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
2. 294 Computer Science & Information Technology (CS & IT)
2. PROPOSED SYSTEM FOR STUDYING ASSOCIATION
Versioning systems have always supported the document / code base management for any
organization. Any such software always acts as a book keeping system for documents repository
or for maintaining source code base of any developing software. It gives the facility to track the
changes done in the particular document with other important associated information like user
name that has changed the document, purpose for the change, and to see the exact changes done
between two versions of a particular document. Based on entities discussed, the classes and
associations between them are shown in fig. 1 and fig. 2 respectively.
2.1 Entities Involved The proposed system has the entities discussed in this section.
Document, an entity represents a document, a source code file, an image file etc. DocumentType
an entity represents type like doc, jpg, htm etc. Version represents the changed version of the
original document. User represents an authorized user who can create a new document or version.
Tag, represent a series that have multiple documents say for a particular release. Contact,
represents the contact of a user.
2.2 Implementation Details
To create a valid schema of the system, each class will have a source code java file and a
mapping XML configuration file.
Source code. An entity is defined as a class and attributes as members of the class. A class will
have one or more public constructors with a mandatory default constructor. Class will also define
pair of get and set method for each property defined in it. Such a java code for Document class
with basic attributes is as below. Similarly, we have implemented the classes for other entities as
well.
public class Document {
private long documentId;
private String name;
public Document() {} //default constructor
public Document(String name) { this.name = name ;}
public long getDocumentId() {return documentId;}
public void setDocumentId(long documentId) {
this.documentId = documentId;}
public String getname() { return this.name;}
public void setname(String name) {this.name = name;}
}
Mapping File. To persist each class, we defined a XML based configuration file that maps a
class as a table and its members as columns. A member can be defined Whereas an attribute could
also be mapped with reference of other class representing the relationship between tables. One
such XML configuration mapping file mapping Document class and its basic attributes in is
presented here.
3. Computer Science & Information Technology (CS & IT) 295
Fig. 1. Complete Class diagram of the system depicting the associations among classes
Fig. 2. Corresponding schema created on the database representing different association types
<? Xml version="1.0"?>
<hibernate-mapping>
<class name="docs.Document" table="DOCUMENT">
<id name="documentId" column="DOC_ID">
<generator class="native"/> </id>
4. 296 Computer Science & Information Technology (CS & IT)
<property name="name" type="string" length="100" not-null="true"
column="DOC_NAME"/>
</class>
</hibernate-mapping>
In discussed mapping file we have not yet included the attributes those create an association
between classes. Refer to figure 1 such attributes for class (or say entity) Document are type,
version and user. We discuss these attributes and related association in next section in detail.
3. ASSOCIATIONS AND THEIR IMPLEMENTATION
Here we discuss implementation of all possible types of unidirectional associations. We discuss
how each association type is mapped into configuration file and various elements suggested in
hibernate. We also discuss the affect of mappings on database.
3.1 Many-to-one unidirectional association Using Foreign Key.
Association from Document to DocumentType is a many-to-one kind of unidirectional
association. For a DocumentType instance, there can be multiple Document instances, whereas, a
Document can be of one DocumentType only. With the same explanation we can define
association from Document to User as many-to-one (fig 3).
Fig. 3. Many-to-one unidirectional association using foreign key
This is mapped as foreign key constraint in the Document table as depicted in the fig. 3. To
specify this mapping in Document class, we used the element <many-to-one> in corresponding
mapping xml file Document.hbm.xml as
<many-to-one name=" docType" class="docs.DocumentType"
column="DOC_TYPE" cascade="save-update"
not-null="true" />
5. Computer Science & Information Technology (CS & IT) 297
On defining this association, the object reference returned by getDocType() method of Document
class is mapped to a foreign key column DOC_TYPE in the DOCUMENT table with reference to
DocumentType class. The specified not-null attribute creates a not null constraint for column
DOC_TYPE so we cannot have a DOCUMENT without a value from the domain for the field
DOC_TYPE. Element cascade with “save-update” tells hibernate to navigate this association
while transaction is committed and save the newly instantiated transient instances
(DocumentType here) and persist changes to detached instances if any. Similarly, the association
from Document to User is defined. Relevent java code and mapping would be
public class Document {
……
private User user;
public User getUser() { return this.user; }
public void setUser(User user) {this.user = user;}
……
}
<many-to-one name="user" class="docs.User"
column="DOC_USER" cascade="save-update"
not-null="true"
/>
An object reference returned by getUser () is mapped to a foreign key column DOC_USER in the
DOCUMENT table. Attribute not-null is true implementing not null constraint for DOC_USER
and cascade is set to save-update to make transient object persistent. The application code to
persist an instance of Document, User and DocumentType is like
………
1. tx = session.beginTransaction();
2. DocumentType doctype = new DocumentType ("txt", "MS Word Document");
3. User user = new User ("Neetu");
4. Document doc1 = new Document("projectReport1", doctype, user);
5. session.save(doc1); // Persist Document instance
6. tx.commit();
Saving an instance of Document (line 5) will insert a row to DOCUMENT table and transient
objects of DOCTYPE and USER due to cascade attribute set to save-update. Without setting the
cascade attribute, we should be saving the instances of DocType and User independently (line 5
and 8 below) before saving the Document object like
3.2 One-to-many Unidirectional Using join table.
Unidirectional one-to-many association is not recommended using foreign key column. We used
join table to implement the same. Mapping from class Document to Version is one-to-many. For a
Document instance we can have multiple Version instances. To implement this, a join table
DOCVERSION is created as shown in fig. 4.
6. 298 Computer Science & Information Technology (CS & IT)
Fig. 4. One-to-many unidirectional using join table
We implemented the version in Document class using a collations type Set as
.............
private Set versions = new HashSet();
public Set getVersions () {return this.versions;}
public void setVersions (Set versions) {
this.versions= versions; }
Hibernate element <many-to-many> is used with unique constraint set to true. Unique property is
used to map the “one” side of one-to-many resulting in the uniqueness constraint to makes sure
that a particular Version instance is not associated with multiple instances of Document.
Corresponding update the configuration file Document.hbm.XML metadata using <set> element
as
<set Name = "versions" table="DOCVERSIONS">
<key column = "DOC_ID"/>
<many-to-many column="VERSION_ID"
class ="docs.Version" unique="true" />
</set>
We tested application to create a new version for an already existing Document object. Line 5, 7
saves two objects of type Version, to add two instances in VERSION table. Line 10, 11 will
attach two versions to a Document doc1that results in saving two rows in table DOCVERSION.
1. ..........
2. tx = session.beginTransaction ();
3. Version ver1 = new Version ("verison1", user);
4. session.save (ver1);
5. Version ver2 = new Version ("verison2", user);
6. session.save (ver2);
7. // Load the already saved Document instance
8. Document doc1 = (Document) session.load
(Document.class, doc1Id);
7. Computer Science & Information Technology (CS & IT) 299
9. // Add version instance ver1, ver2 to Document doc1
10. doc1.getVersions().add(ver1);
11. doc1.getVersions().add(ver2);
We tested unique constraint attaching ver1 to another document doc2
Document doc2 = (Document)session.load
(Document.class, doc2Id);
doc2.getVersions ().add(ver1);
It throws an exception saying violation of integrity constraint. Result is that we can save multiple
Version instances with a single Document but not otherwise.
3.3 One-to-one unidirectional using foreign key.
For one-to-one association type, we introduced Contact class in the system. An instance of
Contact type stores contact for a User instance. We cannot have more than one Contact for a
User. This defines association from User to Contact as one-to-one.
Fig. 5. One-to-one using foreign key
We implemented this using a foreign key column CONTACT_ID in USER table as shown in fig 5.
We used element many-to-one with unique attribute set to true to enforce unique constraint on the
User side as well on Contact object as
<many-to-one name="contact" class="docs.Contact"
column="CONTACT_ID" cascade ="save-update" not-null="true" unique = "true" />
We tested application code that create a Contact instance and associate the same with an User
instance as
1. .....................
2. tx = session.beginTransaction ();
3. Contact contact1 =
new Contact("xyz@abc.com", "12345", "12345");
4. User user1 = new User ("Neetu");
5. user.setContact (contact);
8. 300 Computer Science & Information Technology (CS & IT)
6. session.save (user1);
7. tx.commit();
Persisting an object of type User (line 6) automatically saves the transient Contact instance
contact1 into CONTACT table. Attempt to attach contact1 with user2 object generates an
integrity violation error.
User user2 = new User ("user1");
User2.setContact (contact1);
Caused by: java.sql.SQLException: Unique constraint violation: SYS_CT_472 in statement
[insert into USER (USER_ID, USER_NAME, CONTACT_ID) values (null, ?, ?)] at
org.hsqldb.jdbc.Util.throwError(Unknown Source)at
rg.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source) at
org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:
33)
3.4 Many-to-many Unidirectional.
Association between Tag and Document is of many-to-many type. For an instance of Tag, there
will be multiple instances of Document and vice versa. We successfully implemented this
association using the join table as depicted in fig. 6.
We created a join table TAGDOCS to persist Collection docs added in Tag class. For now, we
only implemented it unidirectional from Tag to Document as
private Set docs = new HashSet();
public Set getDocs() {return this.docs;}
public void setDocs(Set docs) {this.docs = docs;}
……………..
Fig 6. Many-to-many unidirectional association and mapping using join table
9. Computer Science & Information Technology (CS & IT) 301
This association is defined using many-to-many property without setting unique to true opposite
to the case of one-to-many. We have used the property <Set> to persist the collection to create
join table TAGDOCS. Added the following mapping in XML configuration file of Tag class
<set name = "docs" table="TAGDOCS">
<key column = "TAG_ID"/>
<many-to-many column="DOC_ID" class ="docs.Document"/>
</set>
The related java code to associate a Document instance to a Tag is tested. A Tag object is
persisted in TAGS table (line 4) and it is associated with already saved Document objects with
doc1and doc2 with tag object.
1. ...........
2. tx = session.beginTransaction();
3. Tag tag = new Tag("3.0");
4. session.save(tag);
5. tag.getDocs().add(doc1);
6. tag.getDocs().add(doc2);
7. tx.commit();
8. .............
4. CONCLUSIONS AND FUTURE SCOPE
We have implemented and tested a prototype of Document versioning system using ORM
hibernate to understand how different types of possible associations among classes can be
implemented to generate a valid schema and database. We also studied how to incorporate the
constraints like uniqueness, cascading persistence of multiple objects by defining a suitable XML
in hibernate. We tested the code that creates and update database using hibernate query. In future
work, we will incorporate the bidirectional associations in system wherever possible and will
study and test the hibernate implementation required. The complete source code of the system is
available with the author.
ACKNOWLEDGMENT
The writer thanks Mr. Ashutosh Gupta, the reviewer of the paper for his continues support
towards understanding hibernate and troubleshooting during setting up the eclipse, hsqldb
framework and narrow down other technical issues.
REFERENCES
[1] Hibernate, http://www.hibernate.org
[2] Christian Bauer, Gavin King, “Hibernate in Action”, Manning
[3] Bauer, C, King, G 2006 Java Persistence with Hibernate, Manning, Manning 2007
[4] Dia, https://live.gnome.org/Dia
[5] http://www.eclipse.org/
[6] http://hsqldb.org