I am adding Axis 1.4 web services to a working Struts application.
In the Property class file auto-generated from WSDL, the references to java.util.Set are changed to java.lang.Object[].
Set rooms = property.getRooms();
generates error - Type mismatch: cannot convert from Object [] to Set;
Any suggestions or pointers to examples using Axis and Hibernate would be greatly appreciated.
Hibernate version: 3.2
Mapping documents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping
schema="hfydb"
default-cascade="save-update, delete"
auto-import="true"
package="com.hfy.domain"
default-lazy="false">
<class
name="Property"
table="property"
>
<id
name="id"
type="java.lang.Integer"
column="property_id"
>
<generator class="increment" />
</id>
<many-to-one name="office" class="Office" column="office_id" cascade="none" />
<many-to-one name="style" class="Type" column="type_id" cascade="none" />
<many-to-one name="address" class="Address" column="address_id" cascade="all" />
<!-- one-to-many association between Property and Room -->
<!--
http://www.hibernate.org/hib_docs/v3/re ... child.html
the Room entity is managing the FK property_id link,
the inverse attribute tells the collection not to update the link.
all-delete-orphan: a Child can't really exist without its parent
on-delete="cascade" don't delete Room collection prior to removing a Property
CONSTRAINT `FK_PROPERTY_ID` FOREIGN KEY (`PROPERTY_ID`) REFERENCES `property` (`PROPERTY_ID`) ON DELETE CASCADE
the database deletes the rooms if the referenced property is deleted
http://forum.hibernate.org/viewtopic.ph ... aint+fails
-->
<set name="rooms" table="room" inverse="true" cascade="all-delete-orphan" >
<key column="property_id" on-delete="cascade"/>
<one-to-many class="Room" />
</set>
<property
name="appearOnPublic"
type="java.lang.Boolean"
column="public_access"
/>
<property
name="price"
type="java.lang.Integer"
column="price"
/>
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping
schema="hfydb"
default-cascade="save-update, delete"
auto-import="true"
package="com.hfy.domain"
default-lazy="false">
<class
name="Room"
table="room"
>
<id
name="id"
type="java.lang.Integer"
column="room_id"
>
<generator class="increment" />
</id>
<!--
<property
name="property"
type="domain.Property"
column="property_id"
/>
-->
<!-- Make FK property_id part of the mapping -->
<many-to-one name="property" class="Property" column="property_id" not-null="true" />
<many-to-one name="type" class="Type" column="type_id" cascade="none" />
<property
name="name"
type="java.lang.String"
column="name"
not-null="true"
length="30"
/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
MySQL
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html