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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:07:06+00:00 2026-05-15T14:07:06+00:00

In one of my hibernate classes I’ve a Timestamp variable. Now everything was alright

  • 0

In one of my hibernate classes I’ve a Timestamp variable. Now everything was alright when I used only the hibernate stuff on the server. But now I’m implementing webservice with wsgen.

I get an error because Timestamp doesn’t got an no-args default constructor.

Message;

Caused by: java.security.PrivilegedActionException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
java.sql.Timestamp does not have a no-arg default constructor.

The Class:

package com.PTS42.planner;

import java.io.Serializable;
import java.sql.Timestamp;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.persistence.*;
import org.hibernate.annotations.GenericGenerator;

@WebService
@Entity @Table(name="Reserveringen")
public class Reservering implements Serializable {

    @Id @GenericGenerator(name = "generator", strategy = "increment")
    @GeneratedValue(generator = "generator")
    private int id;

    private Timestamp vanaf;

    private Timestamp tot;

    @ManyToOne
    @Embedded
    private Klant klant;

    @ManyToOne
    @Embedded
    private Machine machine;

    public int getId() {
        return id;
    }

    public void setId(@WebParam(name="reservering_id")int id) {
        this.id = id;
    }

    public Klant getKlant() {
        return klant;
    }

    public void setKlant(@WebParam(name="reservering_klant")Klant klant) {
        this.klant = klant;
    }

    public Timestamp getTot() {
        return tot;
    }

    public void setTot(@WebParam(name="reservering_tot")Timestamp tot) {
        int tempint = tot.getMonth();
        tot.setMonth(tempint-1);
        this.tot = tot;
    }

    public Timestamp getVanaf() {
        return vanaf;
    }

    public void setVanaf(@WebParam(name="reservering_vanaf")Timestamp vanaf) {
        int tempint = vanaf.getMonth();
        vanaf.setMonth(tempint-1);
        this.vanaf = vanaf;
    }

    public Machine getMachine() {
        return machine;
    }

    public void setMachine(@WebParam(name="reservering_machine")Machine machine) {
        this.machine = machine;
    }




    public Reservering() {
    }

    public Reservering(@WebParam(name="reservering_constructor_vanaf") Timestamp vanaf, @WebParam(name="reservering_constructor_tot")Timestamp tot, @WebParam(name="reservering_constructor_klant")Klant klant, @WebParam(name="reservering_constructor_machine")Machine machine)
    {

        this.vanaf = vanaf;
        this.tot = tot;
        this.klant = klant;
        this.machine = machine;
    }



}

Anyone know how to solve this, without using an other kind of variable then Timestamp.

  • 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-15T14:07:07+00:00Added an answer on May 15, 2026 at 2:07 pm

    I’m not sure why you’re against using something other than Timestamp. The following code will give you the same database structure and it doesn’t try to expose a SQL class where a SQL class has no business being exposed:

    package com.PTS42.planner;
    
    import java.io.Serializable;
    import java.util.Date
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.persistence.*;
    import org.hibernate.annotations.GenericGenerator;
    
    @WebService
    @Entity @Table(name="Reserveringen")
    public class Reservering implements Serializable {
    
        @Id @GenericGenerator(name = "generator", strategy = "increment")
        @GeneratedValue(generator = "generator")
        private int id;
    
        @Temporal(TemporalType.TIMESTAMP)
        private Date vanaf;
    
        @Temporal(TemporalType.TIMESTAMP)
        private Date tot;
    
        @ManyToOne
        @Embedded
        private Klant klant;
    
        @ManyToOne
        @Embedded
        private Machine machine;
    
        public int getId() {
            return id;
        }
    
        public void setId(@WebParam(name="reservering_id")int id) {
            this.id = id;
        }
    
        public Klant getKlant() {
            return klant;
        }
    
        public void setKlant(@WebParam(name="reservering_klant")Klant klant) {
            this.klant = klant;
        }
    
        public Date getTot() {
            return tot;
        }
    
        public void setTot(@WebParam(name="reservering_tot")Date tot) {
            //int tempint = tot.getMonth();
            //tot.setMonth(tempint-1);
            this.tot = tot;
        }
    
        public Date getVanaf() {
            return vanaf;
        }
    
        public void setVanaf(@WebParam(name="reservering_vanaf")Date vanaf) {
            //int tempint = vanaf.getMonth();
            //vanaf.setMonth(tempint-1);
            this.vanaf = vanaf;
        }
    
        public Machine getMachine() {
            return machine;
        }
    
        public void setMachine(@WebParam(name="reservering_machine")Machine machine) {
            this.machine = machine;
        }
    
        public Reservering() {
        }
    
        public Reservering(@WebParam(name="reservering_constructor_vanaf") Date vanaf, @WebParam(name="reservering_constructor_tot")Date tot, @WebParam(name="reservering_constructor_klant")Klant klant, @WebParam(name="reservering_constructor_machine")Machine machine)
        {
    
            this.vanaf = vanaf;
            this.tot = tot;
            this.klant = klant;
            this.machine = machine;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two classes in a many-to-many relationship, but only one of them have
I am using Hibernate to do mapping. One of my classes have a set
coming from my experience with nHibernate, I wonder how one maps (n)hibernate's component classes
I've got an optional many-to-one relationship between two classes. Hibernate translates the property to
One challenge using hibernate is that manged classes have to have a default constructor
I need to use some legacy classes in Hibernate. One of the classes doesn't
i have one problem in one-to-many mapping using hibernate. i have 2 classes, Person
I have one hibernate sequence, that generates all sequence-numbers in my app. When I
I am trying to persist a one-to-many and a many-to-one relation using Hibernate 4.1.1
I have a Hibernate POJO with 1.an one-to-one association to another object 2.one-to-many association(collection)

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.