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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:06:23+00:00 2026-06-15T22:06:23+00:00

I have a Javascript application that uses Java as a backend with Hibernate, Spring

  • 0

I have a Javascript application that uses Java as a backend with Hibernate, Spring and MySQL DB . When reading data everything works fine and as expected but when trying to edit it on the client side I can see strange behaviour. Even though my server request looks like this :

{"data":{"Draggable":true,"Resizable":true,"StartDate":"2012-09-13T18:00:00+02:00","EndDate":"2012-09-14T04:00:00+02:00","Cls":"","Name":"Secret task","Id":10,"ResourceId":15}}

server responds with :

{"data":[{"Name":"Secret task","Id":10,"StartDate":"2012-09-13T18:00:00+02:00","EndDate":"2012-09-14T04:00:00+02:00","ResourceId":15,"Resizable":null,"Draggable":null,"Cls":""}]}

in which the boolean properties are nulled. I’ve tried ignoring the setter for this field but without any luck. I also had to remove nullable=false as with this included I was getting an error :

org.springframework.dao.DataIntegrityViolationException: not-null property references a null or transient value: model.Event.draggable; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: model.Event.draggable

This is my MySQL table definition :

CREATE TABLE IF NOT EXISTS `events` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) DEFAULT NULL,
  `StartDate` varchar(50) DEFAULT NULL,
  `EndDate` varchar(50) DEFAULT NULL,
  `ResourceId` int(11) DEFAULT NULL,
  `Resizable` tinyint(1) DEFAULT NULL,
  `Draggable` tinyint(1) DEFAULT NULL,
  `Cls` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;

And this is the model code :

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonIgnore;

@JsonAutoDetect
@JsonIgnoreProperties(ignoreUnknown = true)
@Entity
@Table(name="events")
public class Event {

    @Id
    @GeneratedValue
    @Column(name="Id")
    private int id;

    @Column(name="Name", nullable=false)
    private String name;

    @Column(name="StartDate", nullable=false)
    private String startDate;

    @Column(name="EndDate", nullable=false)
    private String endDate;

    @Column(name="ResourceId", nullable=false)
    private int resourceId;

    @Column(name="Resizable")
    private Boolean resizable;

    @Column(name="Draggable")
    private Boolean draggable;

    @Column(name="Cls", nullable=false)
    private String cls;

    @JsonProperty("Id")
    public int getId() {
        return id;
    }

    @JsonProperty("Id")
    public void setId(int id) {
        this.id = id;
    }

    @JsonProperty("Name")
    public String getName() {
        return name;
    }

    @JsonProperty("Name")
    public void setName(String name) {
        this.name = name;
    }

    @JsonProperty("StartDate")
    public String getStartDate() {
        return startDate;
    }

    @JsonProperty("StartDate")
    public void setStartDate(String start) {
        this.startDate = start;
    }

    @JsonProperty("EndDate")
    public String getEndDate() {
        return endDate;
    }

    @JsonProperty("EndDate")
    public void setEndDate(String end) {
        this.endDate = end;
    }

    @JsonProperty("ResourceId")
    public int getResourceId() {
        return resourceId;
    }

    @JsonProperty("ResourceId")
    public void setResourceId(int id) {
        this.resourceId = id;
    }

    @JsonProperty("Resizable")
    public Boolean getResizable() {
        return resizable;
    }

    @JsonIgnore
    public void setResizable(Boolean resizable) {
        this.resizable = resizable;
    }

    @JsonProperty("Draggable")
    public Boolean getDraggable() {
        return draggable;
    }

    @JsonIgnore
    public void setDraggable(Boolean draggable) {
        this.draggable = draggable;
    }

    @JsonProperty("Cls")
    public String getCls() {
        return cls;
    }

    @JsonProperty("Cls")
    public void setCls(String cls) {
        this.cls = cls;
    }
}

Is there anything I can do to prevent this behaviour ?

  • 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-15T22:06:25+00:00Added an answer on June 15, 2026 at 10:06 pm

    You are explicitly telling Jackson to ignore the two properties you mentioned, when deserializing your object from its JSON representation. This:

    @JsonIgnore
    public void setDraggable(Boolean draggable) {
        this.draggable = draggable;
    }
    
    @JsonIgnore
    public void setResizable(Boolean resizable) {
        this.resizable = resizable;
    }
    

    Basically means, ignore these properties when deserializing from my JSON data. So, consequently when you save your object those properties are null in the database.

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

Sidebar

Related Questions

I have a Javascript application that uses Java as a backend with Hibernate, Spring
I have a web application that uses TONS of javascript, and as usual, there
Well, here is my problem: I have an application that uses a custom Javascript
I am currently working on rails3 application that uses jQuery. I have a javascript
I have a mobile web application that uses the Javascript SDK to connect to
I have this android application which uses java-javascript bridge to pick up information from
I have a JavaScript application that works like this: Uploads a file, receives the
I have a web application that uses HTML5, javascript, and jquery to send messages
I have made an iframe style facebook application that uses php and javascript (jquery).
So what i have is a web application that uses c# code and javascript

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.