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 8821481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:51:57+00:00 2026-06-14T05:51:57+00:00

In Rails we have the serialize method, which takes an attribute(or column) that will

  • 0

In Rails we have the serialize method, which takes an attribute(or column) that will be automagically serialized into json when saved in the database.

After that object is saved and queried, the object serialized json can be accessible as real class attributes.

My question is: is there anything build-in or a package that adds this feature to hibernate? If negative, is it possible to create attributes dynamically with the reflection java api?

I’m questioning this because I’m kinda interest into studying a little of Java and what you can do with the JVM.

Thanks.

  • 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-06-14T05:51:58+00:00Added an answer on June 14, 2026 at 5:51 am

    I don’t really understand what you want, sorry.

    But if you want to have a field of an object whose value saved to the database in a serialized form in a single column, rather than being mapped to reference to a row in another table, then that’s a standard part of JPA. You simply define a field, then don’t annotate it with a relationship annotation. I believe the type of the field has to be a subtype of Serializable, though (sadly). For example:

    @Entity
    public class Colleague {
        @Id
        private int id;
        private HashMap<Date, String> diary;
    }
    

    That will map to a table like this:

    create table Colleague (
        id integer primary key,
        diary blob
    )
    

    Now, you mentioned JSON. This won’t use JSON; it will use standard Java serialization. I don’t think there’s any particularly sane way to make it use JSON instead; the easiest would probably be to wrap the object to be serialized in JSONifying wrapper. Not too hard, but a bit weird.

    Still, even though this isn’t JSON, it is useful in much the same way: data goes into the database and then comes back out.

    Again, no idea if this is really what you want, sorry!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a controller action that calls a model method which generates a serialized
I have a method in a rails 3 model that parses XML with nokogiri.
I have a Rails model class with a serialized Hash attribute, like this: class
I have a custom accessor method in my rails 3.1.6 app that assigns a
I have rails app which are working perfectly in the local computer. But when
Hy, I was thinking that all my website will have use of cells, using
In my Rails 3.1.1 project I have an ActiveModel that talks to API (ripped
In a Rails 3.2 app I have a Model with a text column :data
I have this json object (which i don't really know what is inside) and
I have a Model called statistics which has a value field that contains Goals

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.