|
Hibernate example source code file (Alarm.java)
The Hibernate Alarm.java source code//$Id$ package org.hibernate.test.annotations.inheritance.joined; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.JoinColumns; import javax.persistence.OneToOne; @Entity @DiscriminatorValue("AlarmT") public class Alarm extends EventInformation { protected EventInformation eventInfo; @OneToOne @JoinColumns({@JoinColumn(name = "EVENTINFO_NOTIFICATIONID", referencedColumnName = "NOTIFICATIONID")}) public EventInformation getEventInfo() { return eventInfo; } public void setEventInfo(EventInformation value) { this.eventInfo = value; } @Override public String toString() { StringBuilder sb = new StringBuilder(); String eventId = ( getEventInfo() != null ? getEventInfo().getNotificationId() : null ); sb.append( "AlarmT: id = " + getNotificationId() + "\t" + "has event id = " + eventId ); return sb.toString(); } } Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate Alarm.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.