alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (Part.java)

This example Hibernate source code file (Part.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

bigdecimal, bigdecimal, item, item, long, math, part, part, string, string

The Hibernate Part.java source code

package org.hibernate.test.jpa;
import java.math.BigDecimal;

/**
 * @author Steve Ebersole
 */
public class Part {
	private Long id;
	private Item item;
	private String name;
	private String stockNumber;
	private BigDecimal unitPrice;

	public Part() {
	}

	public Part(Item item, String name, String stockNumber, BigDecimal unitPrice) {
		this.item = item;
		this.name = name;
		this.stockNumber = stockNumber;
		this.unitPrice = unitPrice;

		this.item.getParts().add( this );
	}

	public Long getId() {
		return id;
	}

	private void setId(Long id) {
		this.id = id;
	}

	public Item getItem() {
		return item;
	}

	private void setItem(Item item) {
		this.item = item;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getStockNumber() {
		return stockNumber;
	}

	public void setStockNumber(String stockNumber) {
		this.stockNumber = stockNumber;
	}

	public BigDecimal getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(BigDecimal unitPrice) {
		this.unitPrice = unitPrice;
	}
}

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate Part.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.