How to set and get value from the composite key

How to set and get value from the composite key

I am trying to set the value cid in student class using SubjectMark->private String cid; How to set and get value in my controller. Entity's and controller method below:

I am trying to set the value cid in student class using SubjectMark->private String cid; How to set and get value in my controller. Entity's and controller method below:

@Entity
public class Student implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    private SubjectMark id;
    private String fullName;
    private Integer totalMarks;
    private Double percentage;
    private String grade;
    //Setters and getters
}


//Composit class @Embeddable public class SubjectMark implements Serializable { //Composit key private String cid; //Setters and getters

}

In my controller I try to set value like this:

@RequestMapping(value="getstdata",method=RequestMethod.GET)
@ResponseBody
public String getstdata(@RequestParam(value="cid")String cid){
//Some code try{ veclsSt.getId().setVeCovcd(cid); //Set value like this but it is getting null pointer exception Student st=new Student(); st.getId().setCid(); //some code

//retuen some value }

Please help me!

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Spring Boot Tutorials - Spring Boot Full Course

Spring Boot Tutorials | Full Course - What is Spring? Spring Boot is an open source Java-based framework used to create a Micro Service. Spring Boot contains a comprehensive infrastructure support for developing a micro service and enables you to develop enterprise-ready applications that you can “just run”.

Java Spring - Limiting Query Result with Spring Data JPA

Java Spring - Limiting Query Result with Spring Data JPA

Full-stack Reactive Java with Spring Framework, Spring Boot and Project Reactor

Reactive programming offers Java developers a way to build message-driven, elastic, resilient, and responsive services...yet many Java developers don't know where to begin.