Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How to use @XmlID and @XmlIDREF annotations on a entity defined by an interface
How to use @XmlID and @XmlIDREF annotations on a entity defined by an interface [message #730585] Wed, 28 September 2011 16:30
Andr is currently offline AndrFriend
Messages: 2
Registered: September 2011
Junior Member
Hello all

I have the following entities:


class ConstrutoraImpl implements Construtora {
  @XmlID
  private long id;
  
  String nome;  
  String contato;  
  String telefone;
  
  @XmlIDREF
  @XmlList
  private List<Empreendimento> empreendimentos;
}


class EmpreeendimentoImpl  implements Empreendimento {
  @XmlID
  private long id: 
  String nome;
  String endereco;

  private ConstrutoraImpl construtora;
}


When I execute the marshalling process I get the following exception:

javax.xml.bind.JAXBException:
Exception Description: Invalid XmlIDREF on property [empreendimentos].  Class [br.inpe.extfv.entity.api.Empreendimento] is required to have a property annotated with XmlID.
 - with linked exception:
[Exception [EclipseLink-50017] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.JAXBException
Exception Description: Invalid XmlIDREF on property [empreendimentos].  Class [br.inpe.extfv.entity.api.Empreendimento] is required to have a property annotated with XmlID.]
	at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:825)
	at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:136)

	at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:142)


How to use @XmlID and @XmlIDREF annotations on a entity defined by an interface. Is there any kind of proxy definition on this case?

All the Best,
Andre Moutinho
Previous Topic:How can I get the child entitites on a XML marshalling using @XmlID and @XmlIDREF annotations. I onl
Next Topic:Why does @OrderBy add UPPER() to the ORDER BY clause?
Goto Forum:
  


Current Time: Tue Apr 23 15:24:16 GMT 2024

Powered by FUDForum. Page generated in 0.03340 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top