openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jasmin Riemer <jasmin.rie...@gmx.de>
Subject Serialization with @Transient fields
Date Tue, 07 Jul 2009 20:40:31 GMT
Hello everybody,

I have created an entity having attributes which should be
persisted and attriutes which should not be persisted marked with the
@Transient annotation. For example it is something like this:

@Entity
public class MyEntity implements Serializable
{
    @Column
    protected int myInteger;
   
    @Transient
    protected List myList;

    // And so on
}

I need the transient field for holding some content during the 
application which
needs not to be persisted.
Now I want to serialize MyEntity, but there is the problem: All fields 
marked
with @Transient are not serialized. I know there is the "transient" 
modifier which
excludes attributes from serialization, but has @Transient the same effect?

How can I make the application serializing @Transient fields without 
having to persist them?
Has anyone an idea?

Greetings!
Naomi

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message