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

  • SEARCH
  • Home
  • 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 523955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:31:02+00:00 2026-05-13T08:31:02+00:00

I am writing the service to implement the audit in our application wherein users

  • 0

I am writing the service to implement the audit in our application wherein users can view the status of a particular entity before and after any modification and should also be able to roll it back. We have decided to store the XML Serialized object in the databse in XML_TYPE column.

I am new to serialization, I don’t know how to achieve the same, any changes needs to be done to the object to be serialized or do we need to have any mapping XML. Can someone please suggest some good libraries, I understand there are lot of those available in the market like JAXB, JIBX, JABX, XStream and etc. Which one would be good and how to use it.

Any help is highly appreciated.

Regards,
Ravi.

  • 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-13T08:31:02+00:00Added an answer on May 13, 2026 at 8:31 am

    Of course, the best for entities is having POJO’s (Plain Old Java Objects). No strange properties, references or methods. It simplifies serializing and keeps your model objects neutral from frameworks and strange layers like persistence, UI, remote-access and so on.

    XStream: simplicity

    I’d suggest using XStream library for serializing. It tries to be the simplest way to serialize and deserialize objects to XML.

    You should think searialization this way:

    • indicate what class is the object
    • try to serialize each property

    So, these are the two problems to resolve in serializing. XStream lets you create a serializer (XStream class), (OPTIONALLY) indicate what tag name use for each class and (OPTIONALLY) indicate the aliases for properties.

    So if you have something like:

    package pack;
    
    Person
    + mom: Person
    + dad: Person
    

    it will write with no configuration:

    <pack.Person>
      <mom>
        <pack.Person>
        ...
        </pack.Person>
      </mom>
      <dad>
        <pack.Person>
        ...
        </pack.Person>
      </dad>
    </pack.Person>
    

    But if you tell it to map package.Person to it will use that tag. You can tell it to write property “mom” as “mother” and things like that.

    XStream xs = new XStream();
    xs.alias("person", Person.class);
    xs.aliasAttribute(Person.class, "mom", "mother");
    

    References

    XStream also lets you indicate what kind of references you want:

    • no references: serialize an object
      each time it founds it in the object
      tree
    • absolute references: the second time
      an object is found it saves a
      reference using the absolute path of
      the first instance
      (/people/person[4]/teacher)
    • relative references: the same, but
      using a relative reference from this
      point (../../person[4]/teacher)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.