Next in thread → Next in month →

RE: [sdo] Section 3.9.2 of the CD2 Java spec

From
"Carack, Qon"
Date
2010-03-23T13:00:36+00:00
ID
Thread
RE: [sdo] Section 3.9.2 of the CD2 Java spec
I’ve logged this as http://www.osoa.org/jira/browse/SDO-169

 

From: Frank Budinsky [mailto:] 

Sent: Montag, 22. M酺z 2010 20:53

To: 

Subject: [sdo] Section 3.9.2 of the CD2 Java spec

 

There's an example of using JavaHelper on lines 479-483, but it's all messed
up. It's calling the deprecated TypeHelper.define(Class) method and then
calling a nonexistent create(Type) method on the JavaHelper. I'm not sure what
happened there :-)

Anyway, since the spec says that JavaHelper.create(Class) calls define(Class),
the example could just call it:

Customer c = SDO.getDefaultHelperContext().getJavaHelper().create(Customer.class);

((DataObject)c).set(“lastName”,”Smith”);

System.out.println(c.getLastName());

Either that, or we could also show how to do it using DataFactory.create():

Type t =
SDO.getDefaultHelperContext().getJavaHelper().define(Customer.class);

DataObject o =
SDO.getDefaultHelperContext().getDataFactory().create(t);

o.set(“lastName”,”Smith”);

System.out.println(((Customer)o).getLastName());

Maybe we want them both.

Frank.
Next in thread → Next in month →