POJO for Spring JDBC

Create a package com.cosmiclearn.model.
In this package, create a POJO that can hold the cosmic object.

package com.cosmiclearn.model;

public class CosmicObject 
{
	public CosmicObject(String name, String galaxy, 
			double weight, double numberOfEarthYears) 
	{
		super();
		this.name = name;
		this.galaxy = galaxy;
		this.weight = weight;
		this.numberOfEarthYears = numberOfEarthYears;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getGalaxy() {
		return galaxy;
	}
	public void setGalaxy(String galaxy) {
		this.galaxy = galaxy;
	}
	public double getWeight() {
		return weight;
	}
	public void setWeight(double weight) {
		this.weight = weight;
	}
	public double getNumberOfEarthYears() {
		return numberOfEarthYears;
	}
	public void setNumberOfEarthYears(double numberOfEarthYears) {
		this.numberOfEarthYears = numberOfEarthYears;
	}

	private String name;
	private String galaxy;
	private double weight;
	private double numberOfEarthYears;
}

We created a POJO called CosmicObject, that stores data on a CosmicObject.
Name - Name of the Object
Galaxy - Name of the Galaxy to which the object belongs
Weight - The Weight of the Cosmic Object.
Number of Earth Years - Number of Earth Years for One Orbit.

Previous: Maven and Dependencies | Next: Creating Table

<
>