users@jaxb.java.net

Re: Hyperjaxb3 - issue with Sequence

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Fri, 15 May 2009 12:14:31 +0200

Hi,

> Heh. Let me give an example.
>
> 1) My MainObject is a table, which has a column EMBEDDED_OBJECT_ID.
> I've added the attribute-override for it. But the object
> EmbeddedObject also has another element. I don't want to save that
> element, and it's not there is my MainObject table. Is there a way to
> tell hyperjaxb, not to generate attribute-object for it?

hj:ignored on "another element" should work. Check the embeddable example again.

> 2) My generated enum class is like :
> public enum EnumObject {
> A_123("A123"),
> ABC("ABC),
> }
>
> When i do call save on MainObject, it's trying to store A_123 in
> ENUM_OBJECT, instead of A123. I think somehow it's not calling
> .value() on enum. Or may be i am missing something.

I see. This is actually correct and expected behaviour for
@Basic/_at_Enumerated in JPA.
Theoretically HJ3 could implement something like hj:enumerated-value
which would store the value of enum. File an issue in JIRA, I'll
consider it.It's not trivial, though.

Right now your options are:
* Rename typesafe enum members to match values.
* Avoid using typesafe enum class in this case.

Bye.
/lexi