~ubuntu-core-dev/eucalyptus/ubuntu-karmic

« back to all changes in this revision

Viewing changes to clc/modules/core/src/edu/ucsb/eucalyptus/cloud/entities/WalrusSnapshotSet.java

  • Committer: Dmitrii Zagorodnov
  • Date: 2009-01-27 21:53:41 UTC
  • mfrom: (25.1.112 eucalyptus-main)
  • Revision ID: dmitrii@cs.ucsb.edu-20090127215341-i0f0v6cmbpljmg02
merged with current main

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Software License Agreement (BSD License)
 
3
 *
 
4
 * Copyright (c) 2008, Regents of the University of California
 
5
 * All rights reserved.
 
6
 *
 
7
 * Redistribution and use of this software in source and binary forms, with or
 
8
 * without modification, are permitted provided that the following conditions
 
9
 * are met:
 
10
 *
 
11
 * * Redistributions of source code must retain the above
 
12
 *   copyright notice, this list of conditions and the
 
13
 *   following disclaimer.
 
14
 *
 
15
 * * Redistributions in binary form must reproduce the above
 
16
 *   copyright notice, this list of conditions and the
 
17
 *   following disclaimer in the documentation and/or other
 
18
 *   materials provided with the distribution.
 
19
 *
 
20
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 
21
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
22
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
23
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 
24
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
25
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
26
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
27
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
28
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
29
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
30
 * POSSIBILITY OF SUCH DAMAGE.
 
31
 *
 
32
 * Author: Sunil Soman sunils@cs.ucsb.edu
 
33
 */
 
34
 
 
35
package edu.ucsb.eucalyptus.cloud.entities;
 
36
 
 
37
import org.hibernate.annotations.Cache;
 
38
import org.hibernate.annotations.CacheConcurrencyStrategy;
 
39
 
 
40
import javax.persistence.*;
 
41
import java.util.ArrayList;
 
42
import java.util.List;
 
43
 
 
44
 
 
45
@Entity
 
46
@Table( name = "WalrusSnapshotSet" )
 
47
@Cache( usage = CacheConcurrencyStrategy.READ_WRITE )
 
48
public class WalrusSnapshotSet {
 
49
    @Id
 
50
    @GeneratedValue
 
51
    @Column(name = "walrus_snapshot_set_id")
 
52
    private Long id = -1l;
 
53
   //same as the bucket name
 
54
    @Column(name = "snapshotset_id")
 
55
    private String snapshotSetId;
 
56
 
 
57
    @OneToMany( cascade = CascadeType.ALL )
 
58
    @JoinTable(
 
59
            name = "snapshotset_has_snapshots",
 
60
            joinColumns = { @JoinColumn( name = "walrus_snapshot_set_id" ) },
 
61
            inverseJoinColumns = @JoinColumn( name = "walrus_snapshot_id" )
 
62
    )
 
63
    @Cache( usage = CacheConcurrencyStrategy.READ_WRITE )
 
64
    private List<WalrusSnapshotInfo> snapshotSet = new ArrayList<WalrusSnapshotInfo>();
 
65
 
 
66
    public WalrusSnapshotSet() {}
 
67
 
 
68
    public WalrusSnapshotSet(String snapshotSetId) {
 
69
        this.snapshotSetId = snapshotSetId;
 
70
    }
 
71
 
 
72
    public String getSnapshotSetId() {
 
73
        return snapshotSetId;
 
74
    }
 
75
 
 
76
    public void setSnapshotSetId(String snapshotSetId) {
 
77
        this.snapshotSetId = snapshotSetId;
 
78
    }
 
79
 
 
80
    public List<WalrusSnapshotInfo> getSnapshotSet() {
 
81
        return snapshotSet;
 
82
    }
 
83
 
 
84
    public void setSnapshotSet(List<WalrusSnapshotInfo> snapshotSet) {
 
85
        this.snapshotSet = snapshotSet;
 
86
    }
 
87
}
 
 
b'\\ No newline at end of file'