Discussion:
EJB3 Entity: How can I get @Temporal(TemporalType.TIMESTAMP)?
(too old to reply)
André
2009-05-10 00:43:11 UTC
Permalink
Hi all,

I've configured an entity attribute as follows:
- Data Type: "java.util.Date" (in "general" tab);
- Persistent Data Type: "Timestamp" (code "TS", in "Detail" tab);

But "preview" tab displays the generated annotation above the attribute:
- @Temporal(TemporalType.DATE)

Am I doing something wrong? I think that should be
"@Temporal(TemporalType.TIMESTAMP)".

Thanks,

André.
David Dichmann
2009-05-11 16:43:10 UTC
Permalink
André,

Try using the "Annotations" tab on the attribute. The persistent data type
is used for model to model generation mappings. The annotation is driven
off the Annotation setting on the attribute itself, based on the data type
of the attribute (not the persistent tab version). Changing the annotation
field to show TIMESTAMP should do the trick.

- David.
Post by André
Hi all,
- Data Type: "java.util.Date" (in "general" tab);
- Persistent Data Type: "Timestamp" (code "TS", in "Detail" tab);
Am I doing something wrong? I think that should be
Thanks,
André.
André
2009-05-13 15:58:06 UTC
Permalink
Thanks, David, but it didn't work.

The "annotations" tab is empty because "@Temporal" is automatically
generated. If I add "@Temporal(TemporalType.TIMESTAMP)" there, PowerDesigner
generates @Temporal twice :(

Maybe is there something to change in the EJB3 extended model definition?

There's some other weird problems with EJB annotations, for example when I
select the Transaction Attribute Type "Not supported" (EJB 3 class tab),
PowerDesigner generates "@TransactionAttribute(Not supported)" when it
should be "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)".
The workaround here is to type the correct text and add the respective
"import javax.ejb..."

But I cannot find a workaround for @Temporal.

Thanks,

André.
Post by David Dichmann
André,
Try using the "Annotations" tab on the attribute. The persistent data
type is used for model to model generation mappings. The annotation is
driven off the Annotation setting on the attribute itself, based on the
data type of the attribute (not the persistent tab version). Changing the
annotation field to show TIMESTAMP should do the trick.
- David.
Post by André
Hi all,
- Data Type: "java.util.Date" (in "general" tab);
- Persistent Data Type: "Timestamp" (code "TS", in "Detail" tab);
Am I doing something wrong? I think that should be
Thanks,
André.
David Dichmann
2009-05-13 21:02:00 UTC
Permalink
What language and Extended Model Definitions are you using? I might be
using a different set....
- David
Post by André
Thanks, David, but it didn't work.
Maybe is there something to change in the EJB3 extended model definition?
There's some other weird problems with EJB annotations, for example when I
select the Transaction Attribute Type "Not supported" (EJB 3 class tab),
The workaround here is to type the correct text and add the respective
"import javax.ejb..."
Thanks,
André.
Post by David Dichmann
André,
Try using the "Annotations" tab on the attribute. The persistent data
type is used for model to model generation mappings. The annotation is
driven off the Annotation setting on the attribute itself, based on the
data type of the attribute (not the persistent tab version). Changing
the annotation field to show TIMESTAMP should do the trick.
- David.
Post by André
Hi all,
- Data Type: "java.util.Date" (in "general" tab);
- Persistent Data Type: "Timestamp" (code "TS", in "Detail" tab);
Am I doing something wrong? I think that should be
Thanks,
André.
André
2009-05-13 22:48:52 UTC
Permalink
I'm using JDK 1_5_0 library, WSDL for Java, EJB 3.0 and Eclipse extended
model definitions.

Thanks,

André.
Post by David Dichmann
What language and Extended Model Definitions are you using? I might be
using a different set....
- David
Post by André
Thanks, David, but it didn't work.
Maybe is there something to change in the EJB3 extended model definition?
There's some other weird problems with EJB annotations, for example when
I select the Transaction Attribute Type "Not supported" (EJB 3 class
it should be
workaround here is to type the correct text and add the respective
"import javax.ejb..."
Thanks,
André.
Post by David Dichmann
André,
Try using the "Annotations" tab on the attribute. The persistent data
type is used for model to model generation mappings. The annotation is
driven off the Annotation setting on the attribute itself, based on the
data type of the attribute (not the persistent tab version). Changing
the annotation field to show TIMESTAMP should do the trick.
- David.
Post by André
Hi all,
- Data Type: "java.util.Date" (in "general" tab);
- Persistent Data Type: "Timestamp" (code "TS", in "Detail" tab);
Am I doing something wrong? I think that should be
Thanks,
André.
David Dichmann
2009-05-13 23:20:05 UTC
Permalink
I think I still need a few more questions answered:

1) What model taregt language?
2) What object did you build?
(Maybe attach an OOM with the object in it)

I do not get an automatic generated @Temporal but I can get whateer I want
in annotations to work - but I am cheating and reverse engineering the right
code to see what the mode gives me because I cannot seem to find the right
way to get the forward engineering results you see.

I think we're getting closer, I just need a little more help.....

- David.
Post by André
I'm using JDK 1_5_0 library, WSDL for Java, EJB 3.0 and Eclipse extended
model definitions.
Thanks,
André.
Post by David Dichmann
What language and Extended Model Definitions are you using? I might be
using a different set....
- David
Post by André
Thanks, David, but it didn't work.
Maybe is there something to change in the EJB3 extended model definition?
There's some other weird problems with EJB annotations, for example when
I select the Transaction Attribute Type "Not supported" (EJB 3 class
when it should be
workaround here is to type the correct text and add the respective
"import javax.ejb..."
Thanks,
André.
Post by David Dichmann
André,
Try using the "Annotations" tab on the attribute. The persistent data
type is used for model to model generation mappings. The annotation is
driven off the Annotation setting on the attribute itself, based on the
data type of the attribute (not the persistent tab version). Changing
the annotation field to show TIMESTAMP should do the trick.
- David.
Post by André
Hi all,
- Data Type: "java.util.Date" (in "general" tab);
- Persistent Data Type: "Timestamp" (code "TS", in "Detail" tab);
Am I doing something wrong? I think that should be
Thanks,
André.
Loading...