Category: Java

Sort: Date | Title | Views | | Comments Sort Descending
View:

Implement one to one mapping with Hibernate

Added by 3 years ago

947 Views0 Comments

A one-to-one association is similar to many-to-one association with a difference that the column will be set as unique. For example an address object can be associated with a single employee object.... Let us devel...

Implement one to many relationship with Hibernate

Added by 4 years ago

815 Views0 Comments

The goal is to implement the one to many relationship: States id name States id name state States.java public class States implements Serializable{ (...) private id; pr...

Full HD Hibernate tutorial series [part 1] – Install Eclipse Hibernate and Derby database

Added by 4 years ago

1.68K Views0 Comments

1. Install Eclipse and database Download JDK and install it Download Eclipse from eclipse.organd extract the zip file. Download db-derby database from Apache Derby website Download Hibernate from Hibernate.o...

Full HD Hibernate tutorial series [part 2] – Configure Eclipse with Hibernate

Added by 4 years ago

1.06K Views0 Comments

1. Create a "User library" Using top menu click "Window" -> "Preferences" -> Type user -> "User Librairies" -> "New" Click "Add Jar" -> "DerbyClient.jar" Click "Add Jar" -> Select Hibernate J...

Full HD Hibernate tutorial series [part 3] – Write hibernate.cfg.xml file

Added by 4 years ago

1.01K Views0 Comments

Your hibernate.cfg.xml file should look like this <property name="hibernate.connection.driver_class"> org.apache.derby.jdbc.ClientDriver </property> <property name="hibernate.connection.url"> jdbc:...

Full HD Hibernate tutorial series [part 4] – Create Employee class

Added by 4 years ago

922 Views0 Comments

The Employee class should look like this @Entity public class Employee{ private int empId; private String empName; @Id public int getEmpId(){ return empId; } public void setEmpId(int empId){ ...

Full HD Hibernate tutorial series [part 5] – Write a TestEmployee test class

Added by 4 years ago

919 Views0 Comments

public class TestEmployee{ public static void main(){ AnnotationConfiguration conf = new AnnotationConfiguration5-, conf.addAnnotatedClass(Employee.class); new SchemaExport(conf).create(true, true); } }

Full HD Hibernate tutorial series [part 6 ] – Create your own Schema

Added by 4 years ago

851 Views0 Comments

Add this line to your hibernate.cfg.xml file <property name="hibernate.default_schema"> TESTSCHEMA <property> Using SQL scrapbook, execute this statement CREATE SCHEMA testSchema;

Full HD Hibernate tutorial series [part 7] – Insert data into database

Added by 4 years ago

1.18K Views0 Comments

public class TestEmployee{ public static void main(){ AnnotationConfiguration conf = new AnnotationConfiguration5-, conf.addAnnotatedClass(Employee.class); new SchemaExport(conf).create(true, true); ...

Full HD Hibernate tutorial series [part 8] – Questions and answers about Hibernate

Added by 4 years ago

776 Views0 Comments

What are the uses of @Entity and @Id tag? @Entity annotation indicates that the class should persist to the database. @Id annotation represents a unique primary key How do you tell Hibernate which classes are to ...

Full HD Hibernate tutorial series [part 9] – More annotations

Added by 4 years ago

881 Views0 Comments

How to give a custom name of a table? @Table(name="myTableName") How to give a custom name of a column? @Column(name="myColumnName") How to prevent an attribute in a class from being saved into database table? @T...

Full HD Hibernate tutorial series [part 10] – Add a primary key

Added by 4 years ago

783 Views0 Comments

How to add a UNIQUE field? @GeneratedValue //It generates a unique value How to add a UNIQUE primary key field and make it auto-complete? @GeneratedValue(strategy=GenerationType.AUTO) //It generates a uni...

Full HD Hibernate tutorial series [part 11] – Create 2 tables from 1 classe

Added by 4 years ago

684 Views0 Comments

1. Customer class @Entity @Table(name="Customer") @SecondaryTable(name="CustomerDetails") public class Customer{ @Id @GeneratedValue private int customerId; private String customerName; //customerAdd...

Full HD Hibernate tutorial series [part 12] – Create 1 table from 2 classes

Added by 4 years ago

648 Views0 Comments

School.java public class schoom{ private int schoomId; private String schoolName; @Embedded private SchoolDetail schoolDetail; public SchoolDetail getSchoolDetail(){ return schoolDetail; } public...

Full HD Hibernate tutorial series [part 13] – Create a compound key

Added by 4 years ago

829 Views0 Comments

We want to make "userId" and "accountId" primary keys in the table "Account" Compoundkey.java @Embeddable public class Compoundkey implements Serializable{ private int userId; private int accountId; pub...

Full HD Hibernate tutorial series [part 14] – Inheritance mapping

Added by 4 years ago

686 Views0 Comments

Project.java @Entity @Inheritance(strategy=InheritanceType.THEINHERITANCE) public class Project{ @Id @generatedValue private int projectId; private String projectName; } Module.java @Entity publ...

Implement simple form validations in Struts2

Added by 4 years ago

670 Views0 Comments

This video introduces the ActionSupport class and one of the features of the class, validation. We'll look at the validate() method and how we can implement simple form validations in Struts 2.

Struts2 Setting up

Added by 4 years ago

632 Views0 Comments

In this tutorial, we'll set up our development environment to use Struts 2. We'll download the Struts 2 distribution, configure a user library and create a blank web application.

Struts2 Tag and a Business Service

Added by 4 years ago

665 Views0 Comments

Another Channel : http://youtube.com/viveknotty Official Website : http://www.VNRgroups.com Facebook Page : http://www.facebook.com/VNRgroups

Writing Struts2 Application

Added by 4 years ago

627 Views0 Comments

Another Channel : http://youtube.com/viveknotty Official Website : http://www.VNRgroups.com Facebook Page : http://www.facebook.com/VNRgroups

Page 2 of 3123