Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3239004
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:55:09+00:00 2026-05-17T17:55:09+00:00

I want to avoid serialisation ( in JMS / AMF ) but still persist

  • 0

I want to avoid serialisation ( in JMS / AMF ) but still persist the field with JPA/Hibernate.

Is the transient modifier my friend ? Are @Transient annotation and the transient modifier related or not a all ?

The java specification precise that a transient field will not be saved to a persistent storage by a system service. But is hibernate a system service ? ( i dont think so )
http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#78119

And java.io.Serialisable seams to indicate that a out.writeObject and in.readObject are called for serialisation
http://download.oracle.com/javase/1.4.2/docs/api/java/io/Serializable.html

Any insight ?

Maybe should i just write a quick test, but i will be more confident with a piece of spec.

Thank !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:55:09+00:00Added an answer on May 17, 2026 at 5:55 pm

    Is the transient modifier my friend ? Are @Transient annotation and the transient modifier related or not a all ?

    They are not really related but I’m afraid they won’t be your friend anyway, transient properties aren’t persisted by Hibernate/JPA. The JPA specification puts it like this:

    2.1.1 Persistent Fields and Properties

    The persistent state of an entity is
    accessed by the persistence provider
    runtime either via JavaBeans style
    property accessors or via instance
    variables. A single access type (field
    or property access) applies to an
    entity hierarchy. When annotations are
    used, the placement of the mapping
    annotations on either the persistent
    fields or persistent properties of the
    entity class specifies the access type
    as being either field – or property –
    based access respectively.

    • If the entity has field-based access, the persistence provider
      runtime accesses instance variables
      directly. All non-transient
      instance variables that are not
      annotated with the Transient

      annotation are persistent. When
      field-based access is used, the
      object/relational mapping annotations
      for the entity class annotate the
      instance variables.
    • If the entity has property-based access, the persistence provider
      runtime accesses persistent state via
      the property accessor methods. All
      properties not annotated with the
      Transient annotation are persistent.
      The property accessor methods must be
      public or protected. When
      property-based access is used, the
      object/relational mapping annotations
      for the entity class annotate the
      getter property accessors.
    • Mapping annotations cannot be applied to fields or properties that
      are transient or Transient
      .
    • The behavior is unspecified if mapping annotations are applied to
      both persistent fields and properties
      or if the XML descriptor specifies use
      of different access types within a
      class hierarchy.

    …

    References

    • JPA 1.0 specification
      • Section 2.1.1 Persistent Fields
    • Hibernate Core Reference Guide
      • 2.2.2. Mapping simple properties

    Related questions

    • Why does JPA have a @Transient annotation?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to avoid the duplication of stylesheet link tags in the output html
I want to avoid calling a lot of isinstance() functions, so I'm looking for
I want to avoid hardcoding the port number as in the following: httpd =
I want to distribute a webstart application which uses RMI. I want to avoid
I need to generate some passwords, I want to avoid characters that can be
I want to avoid string concatenation to create dynamic SQL query in SQL 2008.
all questions I found want to avoid timeouts in git push/pull. In my case
i need to convert Monthname to integer of that month (and want to avoid
I really don't get why this is not working. I want to avoid a
I want to avoid writing <table></table> and other stuff like that, by writing Java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.