Archive for April, 2009

EMF complex types missing setters

Thursday, April 30th, 2009

When EMF generates Java classes for complex types from XSD it only generates getters but not setters for attributes of the class.

This can be fixed by defining the setter method as an annotated operation.

Make sure your complex type has the following structure:

<xsd:complexType name=”ComplexTypeName”>
<xsd:annotation>
<xsd:appinfo ecore:key=”operations”
source=”http://www.eclipse.org/emf/2002/Ecore”>
<operation name=”setNameOfAttribute”>
<parameter name=”value” type=”ecore:EEList{?}” />
<body />
</operation>
<operation name=”setNameOfSecondAttribute”>
<parameter name=”value” type=”ecore:EEList{?}” />
<body />
</operation>

</xsd:appinfo>
<xsd:documentation>
Documentation on the purpose of your class
</xsd:documentation>
</xsd:annotation>
….
</xsd:complexType>

Appfuse don’t create database every time

Monday, April 27th, 2009

Every time appfuse is started with

mvn jetty:run-war

the database is re-created. If you want to preserve the previous database turn of tests

mvn jetty:run-war -Dmaven.test.skip=true