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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:53:48+00:00 2026-06-13T23:53:48+00:00

Here is the background: I have an annotated @Embeddable Java class that has a

  • 0

Here is the background: I have an annotated @Embeddable Java class that has a GregorianCalendar field. I am attempting to use hibernate3:hbm2ddl to generate a schema via the hibernate3 Maven plugin so that I can persist another object into which this is embedded, but it runs into an error regarding the use of @Temporal.

Here is the embeddable class:

@Embeddable
public class OperationalStatus implements Serializable {
        .
        .
        .
    /**
     * Recorded date/time that the status value is valid
     */
    private GregorianCalendar time;

    /**
     * No-argument constructor.
     */
    public OperationalStatus() {}
        .
        .
        .
    /**
     * @return the time
     */
    @Temporal(TemporalType.TIMESTAMP) 
    public GregorianCalendar getTime() {
        return time;
    }

    /**
     * @param time the time to set
     */
    public void setTime(GregorianCalendar time) {
        this.time = time;
    }
}

And here is the error readout:

[ERROR] Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm
2ddl (default-cli) on project STRIPES_V2: Execution default-cli of goal org.code
haus.mojo:hibernate3-maven-plugin:2.2:hbm2ddl failed: @Temporal should only be s
et on a java.util.Date or java.util.Calendar property: stripes.datamodel.
util.OperationalStatus.time

Here are some excerpts from the pom:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
    <components>
        <component>
            <name>hbm2ddl</name>
            <implementation>annotationconfiguration</implementation>
        </component>
    </components>
    <componentProperties>
        <drop>false</drop>
        <configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
        <outputfilename>schema.sql</outputfilename>
    </componentProperties>
</configuration>
<dependencies>
    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.2-1000.jdbc4</version>
    </dependency>
</dependencies>
</plugin>
.
.
.
<dependency>
    <groupId>org.hibernate</groupId>
    <version>4.1.7.Final</version>
    <artifactId>hibernate-core</artifactId>
</dependency>

What am I missing? GregorianCalendar is a concrete extension of Calendar, so what’s wrong?

  • 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-13T23:53:49+00:00Added an answer on June 13, 2026 at 11:53 pm

    Nothing in the spec constrains the provider to be capable of vending up any particular arbitrary implementation of Calendar you want, so it would be a compatibility issue if they allowed you to require it to give a particular one. (Not that anyone in their right mind would make a new subclass of Calendar, but the possibility is there. A JPA implementation that only knew how to return its own custom subclass of Calendar wouldn’t really be wrong by anything in the spec, you can’t require it to know how to use GregorianCalendar instead.)

    Or on the flip side, if I were to create org.affe.MyAwesomeCalendar, it is not reasonable to expect a JPA provider to be able to make instances of it for me!

    11.1.47 Temporal Annotation

    The Temporal annotation must be specified for persistent fields or properties of type java.util.Date and
    java.util.Calendar. It may only be specified for fields or properties
    of these types.

    Hibernate will not let you choose java.sql.Date etc directly either. Basically they interpret it’s being left up to the persistence provider to determine what implementation of Calendar is used.

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

Sidebar

Related Questions

Background I have a program that has implemented the two classic taxes for Ontario
Ok. Here is some background: I have created a simple APEX application that is
OK, so here's the background: We have a third-party piece of software that does
Background: I have a Flex web app that communicates with a Java back-end via
Some background: I have an database that I want to use linq-to-sql to update
I have googled an serached a lot here about background runnin aps but have
I have menu structure as show here . All item have a background img.
I have an Ul of item. I want to alternate there background color here
Here is the situation: You have one long-running calculation running in a background thread.
I currently have a complete cover background image. Here is the code: #back{ /*

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.