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

Hibernate example source code file (LineItem.java)

This example Hibernate source code file (LineItem.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

lineitem, lineitem, lineitempk, lineitempk, string, string

The Hibernate LineItem.java source code

package org.hibernate.test.idprops;


/**
 * {@inheritDoc}
 *
 * @author Steve Ebersole
 */
public class LineItem {
	private LineItemPK pk;
	private int quantity;
	private String id;

	public LineItem() {
	}

	public LineItem(LineItemPK pk, int quantity) {
		this.pk = pk;
		this.quantity = quantity;
		this.pk.getOrder().getLineItems().add( this );
	}

	public LineItem(Order order, String productCode, int quantity) {
		this( new LineItemPK( order, productCode ), quantity );
	}

	public LineItemPK getPk() {
		return pk;
	}

	public void setPk(LineItemPK pk) {
		this.pk = pk;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
}

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate LineItem.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.