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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:16:21+00:00 2026-06-05T19:16:21+00:00

I have a User and School Class, public class User { private Long id;

  • 0

I have a User and School Class,

public class User {
 private Long id;

 @Property("complete_name")
 private String name;

 private List<School> schools;
 ....
 }

public class School {

 private Long id;

 private Sting name;

 private String otherInfo;
}

I want to update User, School and any other object using a single call. As I do want to make my clients dynamically handle stuff.

I think of a way for this, my declare two call 1 will get all fields and theirs types and other will be able to update the data,

Update looks like
Call 1:

/update?method=editProfile 

Body

{data:[{id:1},{name:"XYZ"}]}

Call 2:

/update?method=editBrand 

Body

{data:[{id:1},{otherInfo:"Some Info"}]}

I call the method using update with method name and params and using reflection load the method and also able to load the fields,

Need help in
1) How can I update fields based on annotated field value e.g complete_name/name
2) How I can validate data in JSON body
3) Whats the best way/json for complex objects.

  • 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-05T19:16:24+00:00Added an answer on June 5, 2026 at 7:16 pm

    I think you’ve got more than one question here and taken as a whole it’s a bit hard to answer but:

    • For JSON <–> Java objects have a look at Jackson
    • For the REST interface your app server will give you a way to respond to HTTP requests. Use the GET method to return data to the client and the PUT or POST method to send data from the client.

    The simplest is probably to have the client send a complete json-ized User structure each time which you can then use to build a Java object (using Jackson), then validate it before updating the version on the server side. Remember to always validate on the server, don’t rely on Javascript in the client!
    If this is too inefficient you can then look at doing incremental updates.

    Hopefully that can get you started.

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

Sidebar

Related Questions

Following scenario: I have user object: ... @Column(name = TITLE) private String title; @NotNull
I have three Models setup with the following associations class User < ActiveRecord::Base has_many
I have the following two models: School and User, and a HABTM relationship between
I have controller with name AdminController where i have method create_school_head : class AdminsController
I have an autocomplete on my site where a user enters a class at
I have four rails models called user, school, subscription and news_item. I a situation
I have user control in my MVC2 app placed in the Content folder (it's
I have user generated podcasts, each with their own RSS feed. Is there a
i have user control, which i render on several views. i want to show
I have User and Teacher models. Teacher belongs_to User and User has_one Teacher. Also

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.