users@glassfish.java.net

Are _at_Transient fields serialized?

From: <glassfish_at_javadesktop.org>
Date: Mon, 09 Jul 2007 01:10:31 PDT

Hello,

I have an Entity that has a field that is marked as @Transient (but not the 'transient' keyword). Something like:

@Entity
class MyEnt implements Serializable
{
   @Id
   private String id;

   @Transient
   private String blah;
}

Now, if I create this entity in an application client (setting 'id' and 'blah' to valid values) and pass it to a remote EJB interface to persist - would you expect 'blah' to be serialized?

It currently isn't, and I don't really know why. The @Transient annotation only applies to persistence mapping and should not affect serialization, or so I would think. The 'id' field is correctly serialized, as expected.

Any ideas?

Thanks
Cameron
[Message sent by forum member 'cameronr' (cameronr)]

http://forums.java.net/jive/thread.jspa?messageID=225679