~raginggoblin/infolog/infolog

« back to all changes in this revision

Viewing changes to InfologServer/lib/hibernate-annotations-3.4.0.GA/test/org/hibernate/test/annotations/inheritance/joined/Alarm.java

  • Committer: Raging Goblin
  • Date: 2013-11-16 16:51:32 UTC
  • Revision ID: raging_goblin-20131116165132-weujnptzc88uy4ah
Mavenized the project, now using shared project InfologSync

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//$Id: Alarm.java 15074 2008-08-14 17:38:00Z epbernard $
2
 
package org.hibernate.test.annotations.inheritance.joined;
3
 
 
4
 
import javax.persistence.DiscriminatorValue;
5
 
import javax.persistence.Entity;
6
 
import javax.persistence.JoinColumn;
7
 
import javax.persistence.JoinColumns;
8
 
import javax.persistence.OneToOne;
9
 
 
10
 
@Entity
11
 
@DiscriminatorValue("AlarmT")
12
 
public class Alarm extends EventInformation {
13
 
 
14
 
        protected EventInformation eventInfo;
15
 
 
16
 
        @OneToOne
17
 
        @JoinColumns({@JoinColumn(name = "EVENTINFO_NOTIFICATIONID",
18
 
                        referencedColumnName = "NOTIFICATIONID")})
19
 
        public EventInformation getEventInfo() {
20
 
                return eventInfo;
21
 
        }
22
 
 
23
 
        public void setEventInfo(EventInformation value) {
24
 
                this.eventInfo = value;
25
 
        }
26
 
 
27
 
 
28
 
        @Override
29
 
        public String toString() {
30
 
                StringBuilder sb = new StringBuilder();
31
 
                String eventId = ( getEventInfo() != null ?
32
 
                                getEventInfo().getNotificationId() : null );
33
 
                sb.append(
34
 
                                "AlarmT: id = " + getNotificationId() + "\t" +
35
 
                                                "has event id = " + eventId
36
 
                );
37
 
                return sb.toString();
38
 
        }
39
 
 
40
 
}