Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b27814220a671f40915b3ebb36515f3bba2ba745 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*******************************************************************************
 * Copyright (c) 2014, 2016 Orange.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package org.eclipse.om2m.commons.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;

import org.eclipse.om2m.commons.constants.DBEntities;
import org.eclipse.om2m.commons.constants.ShortName;

@Entity(name = DBEntities.CUSTOM_ATTRIBUTE_ENTITY)
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class CustomAttributeEntity {
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name=ShortName.RESOURCE_ID)
	protected long resourceID;

	@Column(name= ShortName.CUSTOM_ATTRIBUTE_NAME)
	protected String customAttributeName;
	
	@Column(name = ShortName.CUSTOM_ATTRIBUTE_VALUE)
	protected String customAttributeValue;
	
	@ManyToOne(targetEntity = FlexContainerEntity.class)
	@JoinTable(name = DBEntities.FCNT_CA_JOIN, joinColumns = {
			@JoinColumn(name = DBEntities.CA_JOIN_ID, referencedColumnName = ShortName.RESOURCE_ID) }, inverseJoinColumns = {
					@JoinColumn(name = DBEntities.FCNT_JOIN_ID, referencedColumnName = ShortName.RESOURCE_ID) })
	protected FlexContainerEntity parentFlexContainer;

	public String getCustomAttributeName() {
		return customAttributeName;
	}

	public void setCustomAttributeName(String customAttributeName) {
		this.customAttributeName = customAttributeName;
	}

	public String getCustomAttributeValue() {
		return customAttributeValue;
	}

	public void setCustomAttributeValue(String customAttributeValue) {
		this.customAttributeValue = customAttributeValue;
	}

	public FlexContainerEntity getParentFlexContainer() {
		return parentFlexContainer;
	}

	public void setParentFlexContainer(FlexContainerEntity parentFlexContainer) {
		this.parentFlexContainer = parentFlexContainer;
	}

	public long getResourceID() {
		return resourceID;
	}

	public void setResourceID(long resourceID) {
		this.resourceID = resourceID;
	}
	
	
	

}

Back to the top