Comments on: Using GlassFish Reference Implementation of EJB 3.0 Persistence with JDeveloper 10.1.3EA https://technology.amis.nl/2005/12/28/using-glassfish-reference-implementation-of-ejb-30-persistence-with-jdeveloper-1013ea/ Friends of Oracle and Java Mon, 27 Apr 2015 11:47:05 +0000 hourly 1 http://wordpress.org/?v=4.2.1 By: Keshava Rangarajan https://technology.amis.nl/2005/12/28/using-glassfish-reference-implementation-of-ejb-30-persistence-with-jdeveloper-1013ea/#comment-2727 Tue, 03 Jan 2006 01:41:31 +0000 http://technology.amis.nl/blog/?p=964#comment-2727 Lucas
One more minor point, you might have noticed that since the location Id in the HR
schema was a 4 digit number, I had to change the
service and the client code to insert a long.

Hence in HrmService.java the createDept method looks as follows:

public Department createDept(Long deptno, String dname,
Long loc) {
final Department dept = new Department();
dept.setDeptno(deptno);
dept.setDname(dname);
dept.setLocation(loc);
getEntityManager().persist(dept);
return dept;
}

and in HrmClient.java, the create line looks as follows:

hrmService.createDept(new Long(280),”New Dept”, new Long(1800));

sincerely,
k7

]]>
By: Keshava Rangarajan https://technology.amis.nl/2005/12/28/using-glassfish-reference-implementation-of-ejb-30-persistence-with-jdeveloper-1013ea/#comment-2726 Tue, 03 Jan 2006 01:19:47 +0000 http://technology.amis.nl/blog/?p=964#comment-2726 Oops sorry typo! Meant to say Oracle Express Database not Epress database!
k7

]]>
By: Keshava Rangarajan https://technology.amis.nl/2005/12/28/using-glassfish-reference-implementation-of-ejb-30-persistence-with-jdeveloper-1013ea/#comment-2725 Tue, 03 Jan 2006 01:18:21 +0000 http://technology.amis.nl/blog/?p=964#comment-2725 Lucas,
Thanks a lot for your excellent example. Just got your example working in JDev
with the Epress database using the sample HR schema.
Needed a few minor changes to make it happen. Here they are:

1. In the persistence.xml file the value to the connection string:

2. The JDBC user and password (of course)

2. The persistence mapping entries for the persistent objects:

In Department.java

@Table(name=”DEPARTMENTS”)
public class Department implements Serializable {

@Id
@Column(name=”DEPARTMENT_ID”)
public Long getDeptno() {

@Column(name=”DEPARTMENT_NAME”)
public String getDname() {

@Column(name=”LOCATION_ID”)
public Long getLocation() {

In Employee.java

@Table(name=”EMPLOYEES”)
public class Employee implements Serializable {

@Column(name=”COMMISSION_PCT”)
public Double getComm() {

@Column(name=”DEPARTMENT_ID”)
public Long getDeptno() {

@Id
@Column(name=”EMPLOYEE_ID”, nullable=false)
public Long getEmpno() {

@Column(name=”LAST_NAME”)
public String getEname() {

@Column(name=”HIRE_DATE”)
public Timestamp getHiredate() {

@Column(name=”JOB_ID”)
public String getJob() {

@Column(name=”MANAGER_ID”)
public Long getMgr() {

@Column(name=”SALARY”)
public Double getSal() {

I’ll now start playing around with the mappings. Thanks again!

sincerely,
k7

]]>
By: eduardo ivan pichler https://technology.amis.nl/2005/12/28/using-glassfish-reference-implementation-of-ejb-30-persistence-with-jdeveloper-1013ea/#comment-2724 Wed, 28 Dec 2005 10:21:20 +0000 http://technology.amis.nl/blog/?p=964#comment-2724 Congratulations, this and the before article is the better of category jdeveloper + ejb3
He is very helpful for a begginer like me.
Thanks

]]>