Linked Questions

152 votes
18 answers
439k views

I have model class like this, for hibernate @Entity @Table(name = "user", catalog = "userdb") @JsonIgnoreProperties(ignoreUnknown = true) public class User implements java.io.Serializable { ...
iCode's user avatar
  • 9,282
73 votes
3 answers
39k views

Is there a built-in way to only serialize the id of a child when using Jackson (fasterxml.jackson 2.1.1)? We want to send an Order via REST which has a Person reference. The person object however is ...
Pete's user avatar
  • 10.9k
21 votes
3 answers
18k views

I have an entity with multiple @ManyToOne associations. I am using spring-boot to expose a REST API. Currently, I have multiple REST API's which return a JSON response of the whole entity, including ...
Achaius's user avatar
  • 6,144
1 vote
4 answers
20k views

I have a controller like the following, @RequestMapping(value = "rest/v1/tester") public class TestController { @RequestMapping(value = "/search", method = RequestMethod.GET) public ...
user avatar
2 votes
3 answers
9k views

I have the following classes - Employee public class Employee { private String firstName ; private String lastName ; private String emailAddress ; private String ssn ; } Payroll ...
jagamot's user avatar
  • 5,484
3 votes
3 answers
3k views

I need to serialize an entity with only two column when it's called by a foreign key. I'am working in Wildfly, so I'am searching for a jackson solutions. Suppose I have entity class A public class A{...
Daniele Licitra's user avatar
1 vote
3 answers
2k views

I have MyEntity class: @Entity @Table("entities) public class MyEntity { @ID private String name; @Column(name="age") private int age; @Column(name="weight") private ...
Donatello's user avatar
  • 353
0 votes
4 answers
3k views

I have object that have attributes id, name, description. In some case i want to return whole object but in some i want to return only id, suppose when I insert new record it should only return id ...
Java Curious ღ's user avatar
3 votes
2 answers
814 views

Is it possible to deserialize only fields from interface public interface B { String getB(); } public interface A { String getA(); } public class Impl implements A, B { @Override ...
Kev's user avatar
  • 587
0 votes
1 answer
1k views

I am new to spring boot and rest and hence pardon me if this question is very trivial. I have a situation where the application allows users to register and place order. On registration of user, the ...
svijay.aug12's user avatar
0 votes
1 answer
811 views

I have this method for a GET request with a parameter embedded. The main idea is if the link contains ?embedded=true it returns the entity and if it's not true then it returns a DTO object: @...
Svajunas Kavaliauskas's user avatar
0 votes
0 answers
757 views

I need to exclude fields before a JSON response is sent, depending on the logged in user. Concretely I have [user]s belonging to [company]s. If the logged-in-user is an administor, he/she should be ...
Daniel's user avatar
  • 924