Beginning Hibernate 6 by Joseph B. Ottinger & Jeff Linwood & Dave Minter

Beginning Hibernate 6 by Joseph B. Ottinger & Jeff Linwood & Dave Minter

Author:Joseph B. Ottinger & Jeff Linwood & Dave Minter
Language: eng
Format: epub
ISBN: 9781484273371
Publisher: Apress


public Employee() {

}

// extra housekeeping not echoed here

}

Listing 6-28An Employee Class with a Compound Natural Id

Next, let’s look at a test that demonstrates the use of the natural ID loader, shown in Listing 6-29.27package chapter06.naturalid;

import com.autumncode.hibernate.util.SessionUtil;

import org.hibernate.ObjectNotFoundException;

import org.hibernate.Session;

import org.hibernate.Transaction;

import org.testng.annotations.Test;

import static org.testng.Assert.*;

public class NaturalIdTest extends IdTestBase {

@Test

public void testSimpleNaturalId() {

Integer id = createSimpleEmployee("Sorhed", 5401).getId();



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.