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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:46:54+00:00 2026-05-23T10:46:54+00:00

I’m fairly new to Hibernate. I want to map some object, let’s say String

  • 0

I’m fairly new to Hibernate. I want to map some object, let’s say String to a mysql date (which is a date without time or timezone). I thought this would be fairly straight forward. But I can’t seem to find a good solution.

In my actual app, I’m not using a String. I want to use something like LocalDate in JSR 310 or my own simple month-date-year triplet type.

I really… really don’t want to write some internal setter or getter which translates my simple object into a java.sql.Date or java.util.Date because:

  1. It bloats the domain object with unnecessary code.
  2. I’d have to write the same code in all my domain objects
  3. It sort of defeats the whole purpose of me using this type of class. The whole point of using these classes is to avoid any possible timezone issues. It seems really stupid to introduce a class (java.sql.Date or java.util.Date) which has time and timezone when I only want to persist a simple date (like a birthday date – October 1, 2005).

I suppose the underlying problem is the JDBC driver might only be able to map the core java Date classes to the mysql date types???

  • 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-23T10:46:54+00:00Added an answer on May 23, 2026 at 10:46 am

    May I recommend you look at an already existing solution and see if you can’t either:

    1. Use it in your own Code
    2. Use it as an example to inspire your code

    http://joda-time.sourceforge.net/contrib/hibernate/index.html

    I personally recommend Joda Time for your time/date needs, and there’s already a Hibernate bridge for it. Barring your use of Joda Time, take a look at the URL above, and the code for the hibernate bridge as instruction for how you should be writing a converter.

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

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
i got an object with contents of html markup in it, for example: string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small

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.