|
Hibernate example source code file (Device.java)
The Hibernate Device.java source codepackage org.hibernate.test.annotations.onetoone.hhh4851; import javax.persistence.Column; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.OneToOne; @Entity @DiscriminatorValue(value = "T") public class Device extends Hardware { private ManagedDevice managedDevice; private String tag; public Device() { } @OneToOne(fetch = FetchType.LAZY, mappedBy = "device") public ManagedDevice getManagedDevice() { return managedDevice; } @Column(unique = true, nullable = true) public String getTag() { return tag; } public void setManagedDevice(ManagedDevice logicalterminal) { this.managedDevice = logicalterminal; } public void setTag(String tag) { this.tag = tag; } } Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate Device.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
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.