Define 'namespace' explicitly for add-xmlbinding

10 views
Skip to first unread message

ggran...@gmail.com

unread,
Jan 31, 2017, 1:05:23 PM1/31/17
to minuteproject
Hi Florian,

Is there a way to explicitly define the namespace for the generated entities.   It seems to be using the package name by default.

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace="com.conflictkinetics.eotc.domain.eotc", name = "AppProperty")
@XmlRootElement(namespace="com.conflictkinetics.eotc.domain.eotc")

public class AppProperty extends AbstractDomainObject {
}


ggran...@gmail.com

unread,
Feb 7, 2017, 6:06:25 PM2/7/17
to minuteproject
Also, is there a way to specify that a field should be @XmlTransient ?  Can this be done in the enrichment?   Please give example.

Florian Adler

unread,
Feb 9, 2017, 9:30:12 AM2/9/17
to minute...@googlegroups.com
Hello Greg,

The namespace are directly associated to the package.
At this stage I have not foreseen to change it.
The Xml annotation are quite experimental.

For the @XmlTransient, I have used them in the case of many to many relationship

Form the 
#if($addXmlBinding)
#if($isMasterRelationship)
    @XmlElement (name="$i18nUtils.singularize($childrenListVariable)")
#else
    @XmlTransient
#end
#end

You can force the fact of being a master relationship by enriching the entity
Ex:
<enrichment> 
<entity name="TAG_ITEM" master-relationship-field="ITEMID"/>

Unfortunately you wish the opposite (Change a @XmlElement relationship into a transient one).
There is not this facility available.



--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "minuteproject".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse minuteproject+unsubscribe@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Florian Adler

unread,
Feb 9, 2017, 9:32:16 AM2/9/17
to minute...@googlegroups.com
Hello Greg,

The namespace are directly associated to the package.
At this stage I have not foreseen to change it.
The Xml annotation are quite experimental.

For the @XmlTransient, I have used them in the case of many to many relationship

Form the DomainEntityJPA2Annotation.vm
#if($addXmlBinding)
#if($isMasterRelationship)
    @XmlElement (name="$i18nUtils.singularize($childrenListVariable)")
#else
    @XmlTransient
#end
#end

You can force the fact of being a master relationship by enriching the entity
Ex:
<enrichment> 
   <entity name="TAG_ITEM" master-relationship-field="ITEMID"/>

Unfortunately you wish the opposite (Change a @XmlElement relationship into a transient one).
This facility is not available.

Best regards,

Florian.

Reply all
Reply to author
Forward
0 new messages