Scott Seto

Greenhorn
+ Follow
since Sep 08, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Scott Seto

Hi,

I'm trying to use a MapView with the Kyocera Echo SDK and emulator. I can't use the Google Maps Android API because I have to use the Kyocera add-on's build target. I am using a WebView that contains a map and using the Google Maps Javascript API because I can't use the MapView. Is this a necessary workaround to show maps on the device? or is there some way to include maps.jar?
12 years ago
I did some research and found that I could do the conversion from the hbm.xml file to
the annotated classes in two steps.

The first step would be to use the org.hibernate.tool.hbm2ddl.SchemaExport
class in Hibernate to create the database tables.

Then use the Hibernate Pojo Generator found at:
http://hibernatepojoge.sourceforge.net/
to convert from the database tables to the annotated classes.
Using the source code, I could pick and choose the functions that I want to use.
Hi,

How can I convert an hbm.xml file to JPA annotated classes
using just a simple function call from inside my Java code?
Is there a function or functions in the Hibernate or JPA library that
would help me?

Also, is there an open source tool to convert an existing database into JPA annotated classes?

Thanks.

- Scott
Thanks. That works.

Also, if the value is an xmlString instead of xmlDecimal,
you can use the 'getStringValue()' function.
Hi,

In my XML, I have:
<internationalPrice currency="EUR">423.46</internationalPrice>

I want to use XMLBeans to retrieve both 'EUR' and '423.46' programmatically.
I looked through the functions that XMLBeans creates and it seems as though I
can only retrieve the currency value and not the 423.46 value.

I used the java.lang.Reflect class in Java to find the functions in the InternationalPriceDocument class
that XMLBeans creates and the InternationalPriceDocument.InternationalPrice class.
None of the functions lets me return the 423.46 value.

Thanks in advance for your help.

Here's the XML schema I am using:

<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:po="http://openuri.org/easypo"
targetNamespace="http://openuri.org/easypo"
elementFormDefault="qualified">

<xs:element name="internationalPrice">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="currency" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>

</xs:schema>

Btw, I'm using XMLBeans 2.5