From 457f3b3dc979476081a45792eecfda080dc7ee24 Mon Sep 17 00:00:00 2001 From: Alex Huang Date: Wed, 8 Aug 2012 12:56:26 -0700 Subject: [PATCH] Removed all javax source code from utils package --- core/src/com/cloud/network/VpnUserVO.java | 90 ++-- .../security/SecurityGroupRulesVO.java | 7 +- core/src/com/cloud/user/UserAccountVO.java | 36 +- core/src/com/cloud/user/UserVO.java | 43 +- core/src/com/cloud/vm/VMInstanceVO.java | 385 +++++++++--------- .../cloud/network/CiscoNexusVSMDeviceVO.java | 151 ++++--- .../src/com/cloud/user/AccountDetailVO.java | 17 +- utils/.classpath | 20 +- utils/src/com/cloud/utils/db/Attribute.java | 7 +- .../com/cloud/utils/db/GenericDaoBase.java | 3 +- .../src/com/cloud/utils/db/SqlGenerator.java | 12 +- utils/src/javax/ejb/Local.java | 56 --- .../persistence/AssociationOverride.java | 97 ----- .../persistence/AssociationOverrides.java | 88 ---- .../javax/persistence/AttributeOverride.java | 105 ----- .../javax/persistence/AttributeOverrides.java | 70 ---- utils/src/javax/persistence/Basic.java | 86 ---- utils/src/javax/persistence/CascadeType.java | 62 --- .../javax/persistence/CollectionTable.java | 22 - utils/src/javax/persistence/Column.java | 144 ------- utils/src/javax/persistence/ColumnResult.java | 80 ---- .../persistence/DiscriminatorColumn.java | 101 ----- .../javax/persistence/DiscriminatorType.java | 53 --- .../javax/persistence/DiscriminatorValue.java | 95 ----- .../javax/persistence/ElementCollection.java | 16 - utils/src/javax/persistence/Embeddable.java | 62 --- utils/src/javax/persistence/Embedded.java | 67 --- utils/src/javax/persistence/EmbeddedId.java | 62 --- utils/src/javax/persistence/Entity.java | 59 --- .../persistence/EntityExistsException.java | 87 ---- .../javax/persistence/EntityListeners.java | 57 --- .../persistence/EntityNotFoundException.java | 71 ---- utils/src/javax/persistence/EntityResult.java | 86 ---- .../javax/persistence/EntityTransaction.java | 90 ---- utils/src/javax/persistence/EnumType.java | 51 --- utils/src/javax/persistence/Enumerated.java | 73 ---- utils/src/javax/persistence/FetchType.java | 65 --- utils/src/javax/persistence/FieldResult.java | 81 ---- .../src/javax/persistence/FlushModeType.java | 67 --- .../src/javax/persistence/GeneratedValue.java | 90 ---- .../src/javax/persistence/GenerationType.java | 74 ---- utils/src/javax/persistence/Id.java | 59 --- utils/src/javax/persistence/IdClass.java | 73 ---- utils/src/javax/persistence/Inheritance.java | 70 ---- .../javax/persistence/InheritanceType.java | 58 --- utils/src/javax/persistence/JoinColumn.java | 139 ------- utils/src/javax/persistence/JoinColumns.java | 71 ---- utils/src/javax/persistence/JoinTable.java | 122 ------ utils/src/javax/persistence/Lob.java | 68 ---- utils/src/javax/persistence/LockModeType.java | 86 ---- utils/src/javax/persistence/ManyToMany.java | 146 ------- utils/src/javax/persistence/ManyToOne.java | 99 ----- utils/src/javax/persistence/MapKey.java | 120 ------ .../javax/persistence/MappedSuperclass.java | 152 ------- utils/src/javax/persistence/OneToMany.java | 123 ------ utils/src/javax/persistence/OneToOne.java | 134 ------ utils/src/javax/persistence/OrderBy.java | 110 ----- .../persistence/PersistenceException.java | 86 ---- utils/src/javax/persistence/PostLoad.java | 54 --- utils/src/javax/persistence/PostPersist.java | 54 --- utils/src/javax/persistence/PostRemove.java | 54 --- utils/src/javax/persistence/PostUpdate.java | 54 --- .../persistence/PrimaryKeyJoinColumn.java | 120 ------ .../persistence/PrimaryKeyJoinColumns.java | 73 ---- .../src/javax/persistence/SecondaryTable.java | 120 ------ .../javax/persistence/SecondaryTables.java | 80 ---- .../javax/persistence/SequenceGenerator.java | 91 ----- .../persistence/SqlResultSetMapping.java | 87 ---- .../persistence/SqlResultSetMappings.java | 54 --- utils/src/javax/persistence/Table.java | 91 ----- .../src/javax/persistence/TableGenerator.java | 157 ------- utils/src/javax/persistence/Temporal.java | 69 ---- utils/src/javax/persistence/TemporalType.java | 54 --- utils/src/javax/persistence/Transient.java | 64 --- .../javax/persistence/UniqueConstraint.java | 67 --- utils/src/javax/persistence/Version.java | 77 ---- utils/src/javax/persistence/package.html | 19 - 77 files changed, 393 insertions(+), 5750 deletions(-) delete mode 100644 utils/src/javax/ejb/Local.java delete mode 100644 utils/src/javax/persistence/AssociationOverride.java delete mode 100644 utils/src/javax/persistence/AssociationOverrides.java delete mode 100644 utils/src/javax/persistence/AttributeOverride.java delete mode 100644 utils/src/javax/persistence/AttributeOverrides.java delete mode 100644 utils/src/javax/persistence/Basic.java delete mode 100644 utils/src/javax/persistence/CascadeType.java delete mode 100644 utils/src/javax/persistence/CollectionTable.java delete mode 100644 utils/src/javax/persistence/Column.java delete mode 100644 utils/src/javax/persistence/ColumnResult.java delete mode 100644 utils/src/javax/persistence/DiscriminatorColumn.java delete mode 100644 utils/src/javax/persistence/DiscriminatorType.java delete mode 100644 utils/src/javax/persistence/DiscriminatorValue.java delete mode 100644 utils/src/javax/persistence/ElementCollection.java delete mode 100644 utils/src/javax/persistence/Embeddable.java delete mode 100644 utils/src/javax/persistence/Embedded.java delete mode 100644 utils/src/javax/persistence/EmbeddedId.java delete mode 100644 utils/src/javax/persistence/Entity.java delete mode 100644 utils/src/javax/persistence/EntityExistsException.java delete mode 100644 utils/src/javax/persistence/EntityListeners.java delete mode 100755 utils/src/javax/persistence/EntityNotFoundException.java delete mode 100644 utils/src/javax/persistence/EntityResult.java delete mode 100755 utils/src/javax/persistence/EntityTransaction.java delete mode 100644 utils/src/javax/persistence/EnumType.java delete mode 100644 utils/src/javax/persistence/Enumerated.java delete mode 100644 utils/src/javax/persistence/FetchType.java delete mode 100644 utils/src/javax/persistence/FieldResult.java delete mode 100644 utils/src/javax/persistence/FlushModeType.java delete mode 100644 utils/src/javax/persistence/GeneratedValue.java delete mode 100644 utils/src/javax/persistence/GenerationType.java delete mode 100644 utils/src/javax/persistence/Id.java delete mode 100644 utils/src/javax/persistence/IdClass.java delete mode 100644 utils/src/javax/persistence/Inheritance.java delete mode 100644 utils/src/javax/persistence/InheritanceType.java delete mode 100644 utils/src/javax/persistence/JoinColumn.java delete mode 100644 utils/src/javax/persistence/JoinColumns.java delete mode 100644 utils/src/javax/persistence/JoinTable.java delete mode 100644 utils/src/javax/persistence/Lob.java delete mode 100644 utils/src/javax/persistence/LockModeType.java delete mode 100644 utils/src/javax/persistence/ManyToMany.java delete mode 100644 utils/src/javax/persistence/ManyToOne.java delete mode 100644 utils/src/javax/persistence/MapKey.java delete mode 100644 utils/src/javax/persistence/MappedSuperclass.java delete mode 100644 utils/src/javax/persistence/OneToMany.java delete mode 100644 utils/src/javax/persistence/OneToOne.java delete mode 100644 utils/src/javax/persistence/OrderBy.java delete mode 100644 utils/src/javax/persistence/PersistenceException.java delete mode 100644 utils/src/javax/persistence/PostLoad.java delete mode 100644 utils/src/javax/persistence/PostPersist.java delete mode 100644 utils/src/javax/persistence/PostRemove.java delete mode 100644 utils/src/javax/persistence/PostUpdate.java delete mode 100644 utils/src/javax/persistence/PrimaryKeyJoinColumn.java delete mode 100644 utils/src/javax/persistence/PrimaryKeyJoinColumns.java delete mode 100644 utils/src/javax/persistence/SecondaryTable.java delete mode 100644 utils/src/javax/persistence/SecondaryTables.java delete mode 100644 utils/src/javax/persistence/SequenceGenerator.java delete mode 100644 utils/src/javax/persistence/SqlResultSetMapping.java delete mode 100644 utils/src/javax/persistence/SqlResultSetMappings.java delete mode 100644 utils/src/javax/persistence/Table.java delete mode 100644 utils/src/javax/persistence/TableGenerator.java delete mode 100644 utils/src/javax/persistence/Temporal.java delete mode 100644 utils/src/javax/persistence/TemporalType.java delete mode 100644 utils/src/javax/persistence/Transient.java delete mode 100644 utils/src/javax/persistence/UniqueConstraint.java delete mode 100644 utils/src/javax/persistence/Version.java delete mode 100644 utils/src/javax/persistence/package.html diff --git a/core/src/com/cloud/network/VpnUserVO.java b/core/src/com/cloud/network/VpnUserVO.java index 8b2dc051199..f376e704187 100644 --- a/core/src/com/cloud/network/VpnUserVO.java +++ b/core/src/com/cloud/network/VpnUserVO.java @@ -28,6 +28,7 @@ import javax.persistence.Id; import javax.persistence.Table; import com.cloud.api.Identity; +import com.cloud.utils.db.Encrypt; @Entity @Table(name=("vpn_users")) @@ -39,25 +40,26 @@ public class VpnUserVO implements VpnUser, Identity { @Column(name="owner_id") private long accountId; - + @Column(name="domain_id") private long domainId; @Column(name="username") private String username; - - @Column(name="password", encryptable=true) + + @Encrypt + @Column(name="password") private String password; - + @Column(name="state") @Enumerated(value=EnumType.STRING) private State state; @Column(name="uuid") private String uuid; - + public VpnUserVO() { - this.uuid = UUID.randomUUID().toString(); + this.uuid = UUID.randomUUID().toString(); } public VpnUserVO(long accountId, long domainId, String userName, String password) { @@ -66,7 +68,7 @@ public class VpnUserVO implements VpnUser, Identity { this.username = userName; this.password = password; this.state = State.Add; - this.uuid = UUID.randomUUID().toString(); + this.uuid = UUID.randomUUID().toString(); } @Override @@ -78,51 +80,51 @@ public class VpnUserVO implements VpnUser, Identity { public long getAccountId() { return accountId; } - - @Override + + @Override public String getUsername() { - return username; - } + return username; + } - public void setUsername(String userName) { - this.username = userName; - } + public void setUsername(String userName) { + this.username = userName; + } - @Override + @Override public String getPassword() { - return password; - } - - @Override + return password; + } + + @Override public State getState() { - return state; - } - - public void setState(State state) { - this.state = state; - } + return state; + } - public void setPassword(String password) { - this.password = password; - } + public void setState(State state) { + this.state = state; + } - @Override + public void setPassword(String password) { + this.password = password; + } + + @Override public long getDomainId() { - return domainId; - } - + return domainId; + } - @Override + + @Override public String toString() { - return new StringBuilder("VpnUser[").append(id).append("-").append(username).append("-").append(accountId).append("]").toString(); - } - - @Override - public String getUuid() { - return this.uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } + return new StringBuilder("VpnUser[").append(id).append("-").append(username).append("-").append(accountId).append("]").toString(); + } + + @Override + public String getUuid() { + return this.uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } } diff --git a/core/src/com/cloud/network/security/SecurityGroupRulesVO.java b/core/src/com/cloud/network/security/SecurityGroupRulesVO.java index 56353da8e5a..a671e303c62 100644 --- a/core/src/com/cloud/network/security/SecurityGroupRulesVO.java +++ b/core/src/com/cloud/network/security/SecurityGroupRulesVO.java @@ -24,11 +24,12 @@ import javax.persistence.Id; import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.SecondaryTable; import javax.persistence.Table; + import com.cloud.network.security.SecurityRule.SecurityRuleType; @Entity @Table(name = ("security_group")) -@SecondaryTable(name = "security_group_rule", join = "left", pkJoinColumns = { @PrimaryKeyJoinColumn(name = "id", referencedColumnName = "security_group_id") }) +@SecondaryTable(name = "security_group_rule", pkJoinColumns = { @PrimaryKeyJoinColumn(name = "id", referencedColumnName = "security_group_id") }) public class SecurityGroupRulesVO implements SecurityGroupRules { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -58,7 +59,7 @@ public class SecurityGroupRulesVO implements SecurityGroupRules { @Column(name = "protocol", table = "security_group_rule", insertable = false, updatable = false) private String protocol; - + @Column(name = "type", table = "security_group_rule", insertable = false, updatable = false) private String type; @@ -130,7 +131,7 @@ public class SecurityGroupRulesVO implements SecurityGroupRules { public String getProtocol() { return protocol; } - + @Override public SecurityRuleType getRuleType() { if ("ingress".equalsIgnoreCase(this.type)) { diff --git a/core/src/com/cloud/user/UserAccountVO.java b/core/src/com/cloud/user/UserAccountVO.java index f58e7882d48..5e7c018568a 100644 --- a/core/src/com/cloud/user/UserAccountVO.java +++ b/core/src/com/cloud/user/UserAccountVO.java @@ -27,12 +27,13 @@ import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.SecondaryTable; import javax.persistence.Table; +import com.cloud.utils.db.Encrypt; import com.cloud.utils.db.GenericDao; @Entity @Table(name="user") @SecondaryTable(name="account", - pkJoinColumns={@PrimaryKeyJoinColumn(name="account_id", referencedColumnName="id")}) +pkJoinColumns={@PrimaryKeyJoinColumn(name="account_id", referencedColumnName="id")}) public class UserAccountVO implements UserAccount { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @@ -63,7 +64,8 @@ public class UserAccountVO implements UserAccount { @Column(name="api_key") private String apiKey = null; - @Column(name="secret_key", encryptable=true) + @Encrypt + @Column(name="secret_key") private String secretKey = null; @Column(name=GenericDao.CREATED_COLUMN) @@ -71,13 +73,13 @@ public class UserAccountVO implements UserAccount { @Column(name=GenericDao.REMOVED_COLUMN) private Date removed; - + @Column(name="timezone") private String timezone; - + @Column(name="registration_token") private String registrationToken = null; - + @Column(name="is_registered") boolean registered; @@ -238,32 +240,32 @@ public class UserAccountVO implements UserAccount { public void setAccountDisabled(String accountState) { this.accountState = accountState; } - + @Override - public String getTimezone(){ - return timezone; + public String getTimezone(){ + return timezone; } - + public void setTimezone(String timezone) { - this.timezone = timezone; + this.timezone = timezone; } - + @Override - public String getRegistrationToken(){ - return registrationToken; + public String getRegistrationToken(){ + return registrationToken; } - + public void setRegistrationToken(String registrationToken) { - this.registrationToken = registrationToken; + this.registrationToken = registrationToken; } - + @Override public boolean isRegistered() { return registered; } - + public void setRegistered(boolean registered) { this.registered = registered; } diff --git a/core/src/com/cloud/user/UserVO.java b/core/src/com/cloud/user/UserVO.java index 383dd999659..7e3a7fc2ad4 100644 --- a/core/src/com/cloud/user/UserVO.java +++ b/core/src/com/cloud/user/UserVO.java @@ -17,7 +17,6 @@ package com.cloud.user; import java.util.Date; -import java.util.TimeZone; import java.util.UUID; import javax.persistence.Column; @@ -31,6 +30,7 @@ import javax.persistence.Table; import com.cloud.api.Identity; import com.cloud.user.Account.State; +import com.cloud.utils.db.Encrypt; import com.cloud.utils.db.GenericDao; /** @@ -72,7 +72,8 @@ public class UserVO implements User, Identity { @Column(name = "api_key") private String apiKey = null; - @Column(name = "secret_key", encryptable=true) + @Encrypt + @Column(name = "secret_key") private String secretKey = null; @Column(name = GenericDao.CREATED_COLUMN) @@ -83,25 +84,25 @@ public class UserVO implements User, Identity { @Column(name = "timezone") private String timezone; - + @Column(name="registration_token") private String registrationToken = null; - + @Column(name="is_registered") boolean registered; - + @Column(name="uuid") private String uuid; public UserVO() { - this.uuid = UUID.randomUUID().toString(); + this.uuid = UUID.randomUUID().toString(); } - + public UserVO(long id) { this.id = id; - this.uuid = UUID.randomUUID().toString(); + this.uuid = UUID.randomUUID().toString(); } - + public UserVO(long accountId, String username, String password, String firstName, String lastName, String email, String timezone) { this.accountId = accountId; this.username = username; @@ -111,7 +112,7 @@ public class UserVO implements User, Identity { this.email = email; this.timezone = timezone; this.state = State.enabled; - this.uuid = UUID.randomUUID().toString(); + this.uuid = UUID.randomUUID().toString(); } @Override @@ -228,22 +229,22 @@ public class UserVO implements User, Identity { public void setTimezone(String timezone) { this.timezone = timezone; } - + @Override - public String getRegistrationToken(){ - return registrationToken; + public String getRegistrationToken(){ + return registrationToken; } - + public void setRegistrationToken(String registrationToken) { - this.registrationToken = registrationToken; + this.registrationToken = registrationToken; } - + @Override public boolean isRegistered() { return registered; } - + public void setRegistered(boolean registered) { this.registered = registered; } @@ -252,13 +253,13 @@ public class UserVO implements User, Identity { public String toString() { return new StringBuilder("User[").append(id).append("-").append(username).append("]").toString(); } - + @Override public String getUuid() { - return this.uuid; + return this.uuid; } - + public void setUuid(String uuid) { - this.uuid = uuid; + this.uuid = uuid; } } diff --git a/core/src/com/cloud/vm/VMInstanceVO.java b/core/src/com/cloud/vm/VMInstanceVO.java index 07acae1bc84..4972909c8ff 100644 --- a/core/src/com/cloud/vm/VMInstanceVO.java +++ b/core/src/com/cloud/vm/VMInstanceVO.java @@ -37,6 +37,7 @@ import javax.persistence.TemporalType; import javax.persistence.Transient; import com.cloud.hypervisor.Hypervisor.HypervisorType; +import com.cloud.utils.db.Encrypt; import com.cloud.utils.db.GenericDao; import com.cloud.utils.db.StateMachine; import com.cloud.utils.fsm.FiniteStateObject; @@ -47,20 +48,21 @@ import com.cloud.vm.VirtualMachine.State; @Inheritance(strategy=InheritanceType.JOINED) @DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32) public class VMInstanceVO implements VirtualMachine, FiniteStateObject { - @Id + @Id @TableGenerator(name="vm_instance_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="vm_instance_seq", allocationSize=1) @Column(name="id", updatable=false, nullable = false) - protected long id; + protected long id; @Column(name="name", updatable=false, nullable=false, length=255) - protected String hostName = null; + protected String hostName = null; - @Column(name="vnc_password", updatable=true, nullable=false, length=255, encryptable=true) + @Encrypt + @Column(name="vnc_password", updatable=true, nullable=false, length=255) protected String vncPassword; - + @Column(name="proxy_id", updatable=true, nullable=true) protected Long proxyId; - + @Temporal(TemporalType.TIMESTAMP) @Column(name="proxy_assign_time", updatable=true, nullable=true) protected Date proxyAssignTime; @@ -76,20 +78,20 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject getDetails() { return details; } - + public void setDetail(String name, String value) { assert (details != null) : "Did you forget to load the details?"; - + details.put(name, value); } - + public void setDetails(Map details) { this.details = details; } - transient String toString; + transient String toString; @Override - public String toString() { + public String toString() { if (toString == null) { toString = new StringBuilder("VM[").append(type.toString()).append("|").append(hostName).append("]").toString(); } return toString; } - + @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + (int) (id ^ (id >>> 32)); - return result; - } + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + (int) (id ^ (id >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + VMInstanceVO other = (VMInstanceVO) obj; + if (id != other.id) + return false; + return true; + } + - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - VMInstanceVO other = (VMInstanceVO) obj; - if (id != other.id) - return false; - return true; - } - - public void setServiceOfferingId(long serviceOfferingId) { this.serviceOfferingId = serviceOfferingId; } diff --git a/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceVO.java b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceVO.java index 073287103bc..af9ff0e1d7c 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceVO.java +++ b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceVO.java @@ -27,6 +27,7 @@ import javax.persistence.Id; import javax.persistence.Table; import com.cloud.api.Identity; +import com.cloud.utils.db.Encrypt; /** * CiscoNexusVSMDeviceVO contains information on external Cisco Nexus 1000v VSM devices added into a deployment. @@ -37,176 +38,192 @@ import com.cloud.api.Identity; @Entity @Table(name="virtual_supervisor_module") public class CiscoNexusVSMDeviceVO implements CiscoNexusVSMDevice, Identity{ - - // We need to know what properties a VSM has. Put them here. - + + // We need to know what properties a VSM has. Put them here. + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private long id; @Column(name="uuid") - private String uuid; + private final String uuid; @Column(name = "host_id") private long hostId; @Column(name = "vsm_name") private String vsmName; - + @Column(name = "username") private String vsmUserName; - - @Column(name = "password", encryptable=true) + + @Encrypt + @Column(name = "password") private String vsmPassword; @Column(name = "ipaddr") private String ipaddr; - + @Column(name = "management_vlan") private int managementVlan; @Column(name = "control_vlan") private int controlVlan; - + @Column(name = "packet_vlan") private int packetVlan; - + @Column(name = "storage_vlan") private int storageVlan; - + @Column(name = "vsm_domain_id") private long vsmDomainId; - + @Column(name = "config_mode") private VSMConfigMode vsmConfigMode; - + @Column(name = "config_state") private VSMConfigState vsmConfigState; - + @Column(name = "vsm_device_state") private VSMDeviceState vsmDeviceState; // Accessor methods + @Override public long getId() { return id; } + @Override public String getvsmName() { - return vsmName; + return vsmName; } - + + @Override public long getHostId() { return hostId; } - + + @Override public String getUserName() { - return vsmUserName; - } - - public String getPassword() { - return vsmPassword; + return vsmUserName; } + @Override + public String getPassword() { + return vsmPassword; + } + + @Override public String getipaddr() { - return ipaddr; + return ipaddr; } - + + @Override public int getManagementVlan() { - return managementVlan; + return managementVlan; } - + + @Override public int getControlVlan() { - return controlVlan; + return controlVlan; } - + + @Override public int getPacketVlan() { - return packetVlan; + return packetVlan; } + @Override public int getStorageVlan() { - return storageVlan; + return storageVlan; } - + + @Override public long getvsmDomainId() { - return vsmDomainId; + return vsmDomainId; } - + + @Override public VSMConfigMode getvsmConfigMode() { - return vsmConfigMode; + return vsmConfigMode; } - + + @Override public VSMConfigState getvsmConfigState() { - return vsmConfigState; + return vsmConfigState; } - + + @Override public VSMDeviceState getvsmDeviceState() { - return vsmDeviceState; + return vsmDeviceState; } - + + @Override public String getUuid() { return uuid; } - + // Setter methods public void setHostId(long hostid) { this.hostId = hostid; } - + public void setVsmUserName(String username) { - this.vsmUserName = username; + this.vsmUserName = username; } - + public void setVsmName(String vsmName) { - this.vsmName = vsmName; + this.vsmName = vsmName; } - + public void setVsmPassword(String password) { - this.vsmPassword = password; + this.vsmPassword = password; } public void setMgmtIpAddr(String ipaddr) { - this.ipaddr = ipaddr; + this.ipaddr = ipaddr; } - + public void setManagementVlan(int vlan) { - this.managementVlan = vlan; + this.managementVlan = vlan; } - + public void setControlVlan(int vlan) { - this.controlVlan = vlan; + this.controlVlan = vlan; } - + public void setPacketVlan(int vlan) { - this.packetVlan = vlan; + this.packetVlan = vlan; } public void setStorageVlan(int vlan) { - this.storageVlan = vlan; + this.storageVlan = vlan; } - + public void setVsmDomainId(long id) { - this.vsmDomainId = id; + this.vsmDomainId = id; } - + public void setVsmConfigMode(VSMConfigMode mode) { - this.vsmConfigMode = mode; + this.vsmConfigMode = mode; } - + public void setVsmConfigState(VSMConfigState state) { - this.vsmConfigState = state; + this.vsmConfigState = state; } - + public void setVsmDeviceState(VSMDeviceState devState) { - this.vsmDeviceState = devState; + this.vsmDeviceState = devState; } - - + + // Constructors. - + public CiscoNexusVSMDeviceVO(String vsmIpAddr, String username, String password) { - // Set all the VSM's properties here. + // Set all the VSM's properties here. this.uuid = UUID.randomUUID().toString(); this.setMgmtIpAddr(vsmIpAddr); this.setVsmUserName(username); @@ -214,7 +231,7 @@ public class CiscoNexusVSMDeviceVO implements CiscoNexusVSMDevice, Identity{ this.setVsmName(vsmName); this.setVsmDeviceState(VSMDeviceState.Enabled); } - + public CiscoNexusVSMDeviceVO() { this.uuid = UUID.randomUUID().toString(); } diff --git a/server/src/com/cloud/user/AccountDetailVO.java b/server/src/com/cloud/user/AccountDetailVO.java index 7860b97c7a0..76c87b11107 100755 --- a/server/src/com/cloud/user/AccountDetailVO.java +++ b/server/src/com/cloud/user/AccountDetailVO.java @@ -23,6 +23,8 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; +import com.cloud.utils.db.Encrypt; + @Entity @Table(name="account_details") public class AccountDetailVO { @@ -30,25 +32,26 @@ public class AccountDetailVO { @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") private long id; - + @Column(name="account_id") private long accountId; - + @Column(name="name") private String name; - - @Column(name="value", encryptable=true) + + @Encrypt + @Column(name="value") private String value; - + protected AccountDetailVO() { } - + public AccountDetailVO(long accountId, String name, String value) { this.accountId = accountId; this.name = name; this.value = value; } - + public long getAccountId() { return accountId; } diff --git a/utils/.classpath b/utils/.classpath index 0d8ee3ddadd..5f65a8219ec 100644 --- a/utils/.classpath +++ b/utils/.classpath @@ -1,22 +1,4 @@ - @@ -24,5 +6,7 @@ under the License. + + diff --git a/utils/src/com/cloud/utils/db/Attribute.java b/utils/src/com/cloud/utils/db/Attribute.java index c5f17509195..22fd9693b98 100755 --- a/utils/src/com/cloud/utils/db/Attribute.java +++ b/utils/src/com/cloud/utils/db/Attribute.java @@ -120,7 +120,7 @@ public class Attribute { flags = Flag.AutoGV.setTrue(flags); } } - + if (isEmbedded) { flags = Flag.Embedded.setTrue(flags); } @@ -144,7 +144,8 @@ public class Attribute { if (column == null || column.nullable()) { flags = Flag.Nullable.setTrue(flags); } - if (column != null && column.encryptable()) { + Encrypt encrypt = field.getAnnotation(Encrypt.class); + if (encrypt != null && encrypt.encrypt()) { flags = Flag.Encrypted.setTrue(flags); } } @@ -207,7 +208,7 @@ public class Attribute { public final boolean isEncrypted() { return Flag.Encrypted.check(flags); } - + public Field getField() { return field; } diff --git a/utils/src/com/cloud/utils/db/GenericDaoBase.java b/utils/src/com/cloud/utils/db/GenericDaoBase.java index 938ae15717e..3df83747f31 100755 --- a/utils/src/com/cloud/utils/db/GenericDaoBase.java +++ b/utils/src/com/cloud/utils/db/GenericDaoBase.java @@ -499,7 +499,8 @@ public abstract class GenericDaoBase implements Gene byte[] bytes = rs.getBytes(index); if(bytes != null) { try { - if(field.getAnnotation(Column.class).encryptable()){ + Encrypt encrypt = field.getAnnotation(Encrypt.class); + if (encrypt != null && encrypt.encrypt()){ field.set(entity, DBEncryptionUtil.decrypt(new String(bytes, "UTF-8"))); } else { field.set(entity, new String(bytes, "UTF-8")); diff --git a/utils/src/com/cloud/utils/db/SqlGenerator.java b/utils/src/com/cloud/utils/db/SqlGenerator.java index 6af1a80521c..437cad13a1f 100755 --- a/utils/src/com/cloud/utils/db/SqlGenerator.java +++ b/utils/src/com/cloud/utils/db/SqlGenerator.java @@ -134,7 +134,7 @@ public class SqlGenerator { } Attribute attr = new Attribute(clazz, overrides, field, tableName, embedded, isId); - + if (attr.getColumnName().equals(GenericDao.REMOVED_COLUMN)) { attr.setColumnName(GenericDao.REMOVED); attr.setTrue(Attribute.Flag.DaoGenerated); @@ -279,7 +279,7 @@ public class SqlGenerator { public Attribute findAttribute(String name) { for (Attribute attr : _attributes) { - + if (attr.columnName.equalsIgnoreCase(name)) { if (attr.columnName.equalsIgnoreCase(GenericDao.REMOVED) && attr.isUpdatable()) { return null; @@ -315,8 +315,8 @@ public class SqlGenerator { } if (attrs.size() != 0) { Pair pair = - new Pair(buildUpdateSql(tableName, attrs), attrs.toArray(new Attribute[attrs.size()])); - sqls.add(pair); + new Pair(buildUpdateSql(tableName, attrs), attrs.toArray(new Attribute[attrs.size()])); + sqls.add(pair); } } return sqls; @@ -539,7 +539,7 @@ public class SqlGenerator { SecondaryTable[] sts = DbUtil.getSecondaryTables(clazz); ArrayList secondaryTables = new ArrayList(); for (SecondaryTable st : sts) { - addPrimaryKeyJoinColumns(innerJoin, tableName, st.name(), st.join(), st.pkJoinColumns()); + addPrimaryKeyJoinColumns(innerJoin, tableName, st.name(), "", st.pkJoinColumns()); secondaryTables.add(st.name()); } @@ -566,7 +566,7 @@ public class SqlGenerator { public Pair buildSelectSql(boolean enable_query_cache) { StringBuilder sql = new StringBuilder("SELECT "); - + sql.append(enable_query_cache ? "SQL_CACHE ": ""); ArrayList attrs = new ArrayList(); diff --git a/utils/src/javax/ejb/Local.java b/utils/src/javax/ejb/Local.java deleted file mode 100644 index d18fd6c74f7..00000000000 --- a/utils/src/javax/ejb/Local.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ - -package javax.ejb; - -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.ElementType; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; - -/** - * When used on the bean class, declares the local business interface(s) - * for a session bean. When used on an interface, designates that interface - * as a local business interface. In this case, no value() is provided. - * - */ - -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Local { - Class[] value() default {}; -} diff --git a/utils/src/javax/persistence/AssociationOverride.java b/utils/src/javax/persistence/AssociationOverride.java deleted file mode 100644 index 736297bb9e1..00000000000 --- a/utils/src/javax/persistence/AssociationOverride.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation is used to override a many-to-one or - * one-to-one mapping of property or field for an entity relationship. - * - *

The AssociationOverride annotation may be applied - * to an entity that extends a mapped superclass to override a many-to-one - * or one-to-one mapping defined by the mapped superclass. If the - * AssociationOverride annotation is not specified, the join - * column is mapped the same as in the original mapping. - *

- *    Example:
- *    @MappedSuperclass
- *    public class Employee {
- *        ...
- *        @ManyToOne
- *        protected Address address;
- *        ...
- *    }
- *    
- *    @Entity 
- *    @AssociationOverride(name="address", 
- *        joinColumns=@JoinColumn(name="ADDR_ID"))
- *    // address field mapping overridden to ADDR_ID fk
- *    public class PartTimeEmployee extends Employee {
- *        ...
- *    }
- * 
- * - * @see OneToOne - * @see ManyToOne - * @see MappedSuperclass - * - * @since Java Persistence 1.0 - */ -@Target({TYPE, METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface AssociationOverride { - - /** - * The name of the relationship property whose mapping is - * being overridden if property-based access is being used, - * or the name of the relationship field if field-based access is used. - */ - String name(); - - /** - * The join column that is being mapped to the persistent - * attribute. The mapping type will remain the same as is defined - * in the mapped superclass. - */ - JoinColumn[] joinColumns(); -} diff --git a/utils/src/javax/persistence/AssociationOverrides.java b/utils/src/javax/persistence/AssociationOverrides.java deleted file mode 100644 index d0ed61ef867..00000000000 --- a/utils/src/javax/persistence/AssociationOverrides.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation is used to override mappings of multiple - * many-to-one or one-to-one relationship properties or fields. - * - *
- *    
- *    Example:
- *    @MappedSuperclass
- *    public class Employee {
- *    
- *        @Id protected Integer id;
- *        @Version protected Integer version;
- *        @ManyToOne protected Address address;
- *        @OneToOne protected Locker locker;
- *    
- *        public Integer getId() { ... }
- *        public void setId(Integer id) { ... }
- *        public Address getAddress() { ... }
- *        public void setAddress(Address address) { ... }
- *        public Locker getLocker() { ... }
- *        public void setLocker(Locker locker) { ... }
- *    
- *    }
- *    
- *    @Entity
- *    @AssociationOverrides({
- *    
- *    @AssociationOverride(name="address", 
- *            joinColumns=@JoinColumn("ADDR_ID")),
- *        @AttributeOverride(name="locker", 
- *            joinColumns=@JoinColumn("LCKR_ID"))})
- *    public PartTimeEmployee { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE, METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface AssociationOverrides { - - /** Mapping overrides of relationship properties or fields */ - AssociationOverride[] value(); -} diff --git a/utils/src/javax/persistence/AttributeOverride.java b/utils/src/javax/persistence/AttributeOverride.java deleted file mode 100644 index 23ead7aeb75..00000000000 --- a/utils/src/javax/persistence/AttributeOverride.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * The AttributeOverride annotation is used to - * override the mapping of a {@link Basic} (whether explicit or - * default) property or field or Id property or field. - * - *

The AttributeOverride annotation may be - * applied to an entity that extends a mapped superclass or to - * an embedded field or property to override a basic mapping - * defined by the mapped superclass or embeddable class. If the - * AttributeOverride annotation is not specified, - * the column is mapped the same as in the original mapping. - * - *

- * 

Example: - * - * @MappedSuperclass - * public class Employee { - * @Id protected Integer id; - * @Version protected Integer version; - * protected String address; - * public Integer getId() { ... } - * public void setId(Integer id) { ... } - * public String getAddress() { ... } - * public void setAddress(String address) { ... } - * } - * - * @Entity - * @AttributeOverride(name="address", column=@Column(name="ADDR")) - * public class PartTimeEmployee extends Employee { - * // address field mapping overridden to ADDR - * protected Float wage(); - * public Float getHourlyWage() { ... } - * public void setHourlyWage(Float wage) { ... } - * } - *

- * - * @see Embedded - * @see Embeddable - * @see MappedSuperclass - * - * @since Java Persistence 1.0 - */ -@Target({TYPE, METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface AttributeOverride { - - /** - * (Required) The name of the property whose mapping is being - * overridden if property-based access is being used, or the - * name of the field if field-based access is used. - */ - String name(); - - /** - * (Required) The column that is being mapped to the persistent - * attribute. The mapping type will remain the same as is - * defined in the embeddable class or mapped superclass. - */ - Column column(); -} diff --git a/utils/src/javax/persistence/AttributeOverrides.java b/utils/src/javax/persistence/AttributeOverrides.java deleted file mode 100644 index c1d0f9b2f48..00000000000 --- a/utils/src/javax/persistence/AttributeOverrides.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Is used to override mappings of multiple properties or fields. - * - *
- *
- *    Example:
- *
- *    @Embedded
- *    @AttributeOverrides({
- *            @AttributeOverride(name="startDate", column=@Column("
- *                    EMP_START")),
- *            @AttributeOverride(name="endDate", column=@Column("EMP_END"))
- *    })
- *    public EmploymentPeriod getEmploymentPeriod() { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE, METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface AttributeOverrides { - - /** One or more mapping override */ - AttributeOverride[] value(); -} diff --git a/utils/src/javax/persistence/Basic.java b/utils/src/javax/persistence/Basic.java deleted file mode 100644 index e1430f44153..00000000000 --- a/utils/src/javax/persistence/Basic.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static javax.persistence.FetchType.EAGER; - -/** - * The Basic annotation is the simplest type of mapping - * to a database column. The Basic annotation can be - * applied to a persistent property or instance variable of any of the - * following types: Java primitive types, wrappers of the primitive types, - * {@link String}, {@link java.math.BigInteger java.math.BigInteger}, - * {@link java.math.BigDecimal java.math.BigDecimal}, - * {@link java.util.Date java.util.Date}, - * {@link java.util.Calendar java.util.Calendar}, - * {@link java.sql.Date java.sql.Date}, {@link java.sql.Time java.sql.Time}, - * {@link java.sql.Timestamp java.sql.Timestamp}, byte[], Byte[], - * char[], Character[], enums, and any other type that implements - * {@link java.io.Serializable Serializable}. - * - *

The use of the Basic annotation is optional for - * persistent fields and properties of these types. - * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface Basic { - - /** - * (Optional) Defines whether the value of the field or property should - * be lazily loaded or must be eagerly fetched. The EAGER - * strategy is a requirement on the persistence provider runtime - * that the value must be eagerly fetched. The LAZY - * strategy is a hint to the persistence provider runtime. - * If not specified, defaults to EAGER. - */ - FetchType fetch() default EAGER; - - /** - * (Optional) Defines whether the value of the field or property may be null. - * This is a hint and is disregarded for primitive types; it may - * be used in schema generation. - * If not specified, defaults to true. - */ - boolean optional() default true; -} diff --git a/utils/src/javax/persistence/CascadeType.java b/utils/src/javax/persistence/CascadeType.java deleted file mode 100644 index b4dc0a2318a..00000000000 --- a/utils/src/javax/persistence/CascadeType.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * Defines the set of cascadable operations that are propagated - * to the associated entity. - * The value cascade=ALL is equivalent to - * cascade={PERSIST, MERGE, REMOVE, REFRESH}. - * - * @since Java Persistence 1.0 - */ -public enum CascadeType { - - /** Cascade all operations */ - ALL, - - /** Cascade persist operation */ - PERSIST, - - /** Cascade merge operation */ - MERGE, - - /** Cascade remove operation */ - REMOVE, - - /** Cascade refresh operation */ - REFRESH -} diff --git a/utils/src/javax/persistence/CollectionTable.java b/utils/src/javax/persistence/CollectionTable.java deleted file mode 100644 index 936e31dce15..00000000000 --- a/utils/src/javax/persistence/CollectionTable.java +++ /dev/null @@ -1,22 +0,0 @@ -package javax.persistence; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target(value = { METHOD, FIELD }) -@Retention(value = RetentionPolicy.RUNTIME) -public @interface CollectionTable { - String catalog() default ""; - - JoinColumn[] joinColumns() default {}; - - String name() default ""; - - String schema() default ""; - - UniqueConstraint[] uniqueConstraints() default {}; -} diff --git a/utils/src/javax/persistence/Column.java b/utils/src/javax/persistence/Column.java deleted file mode 100644 index 13606f2510a..00000000000 --- a/utils/src/javax/persistence/Column.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Is used to specify a mapped column for a persistent property or field. - * If no Column annotation is specified, the default values are applied. - *

Examples: - * - *

- * Example 1:
- * @Column(name="DESC", nullable=false, length=512)
- * public String getDescription() { return description; }
- *
- * Example 2:
- * @Column(name="DESC",
- *         columnDefinition="CLOB NOT NULL",
- *         table="EMP_DETAIL")
- * @Lob
- * public String getDescription() { return description; }
- *
- * Example 3:
- * @Column(name="ORDER_COST", updatable=false, precision=12, scale=2)
- * public BigDecimal getCost() { return cost; }
- *
- * 
- * - * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface Column { - - /** - * (Optional) The name of the column. Defaults to - * the property or field name. - */ - String name() default ""; - - /** - * (Optional) Whether the property is a unique key. This is a - * shortcut for the UniqueConstraint annotation at the table - * level and is useful for when the unique key constraint is - * only a single field. This constraint applies in addition - * to any constraint entailed by primary key mapping and - * to constraints specified at the table level. - */ - boolean unique() default false; - - /** - * (Optional) Whether the database column is nullable. - */ - boolean nullable() default true; - - /** - * (Optional) Whether the column is included in SQL INSERT - * statements generated by the persistence provider. - */ - boolean insertable() default true; - - /** - * (Optional) Whether the column is included in SQL UPDATE - * statements generated by the persistence provider. - */ - boolean updatable() default true; - - /** - * (Optional) The SQL fragment that is used when - * generating the DDL for the column. - *

Defaults to the generated SQL to create a - * column of the inferred type. - */ - String columnDefinition() default ""; - - /** - * (Optional) The name of the table that contains the column. - * If absent the column is assumed to be in the primary table. - */ - String table() default ""; - - /** - * (Optional) The column length. (Applies only if a - * string-valued column is used.) - */ - int length() default 255; - - /** - * (Optional) The precision for a decimal (exact numeric) - * column. (Applies only if a decimal column is used.) - * Value must be set by developer if used when generating - * the DDL for the column. - */ - int precision() default 0; - - /** - * (Optional) The scale for a decimal (exact numeric) column. - * (Applies only if a decimal column is used.) - */ - int scale() default 0; - /** - * (Optional) Whether encryption should be used for this column - */ - boolean encryptable() default false; -} diff --git a/utils/src/javax/persistence/ColumnResult.java b/utils/src/javax/persistence/ColumnResult.java deleted file mode 100644 index bc7ea299ee0..00000000000 --- a/utils/src/javax/persistence/ColumnResult.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * References name of a column in the SELECT clause of a SQL query - - * i.e., column alias, if applicable. Scalar result types can be - * included in the query result by specifying this annotation in - * the metadata. - * - *

- *
- * Example:
- *   Query q = em.createNativeQuery(
- *       "SELECT o.id AS order_id, " +
- *           "o.quantity AS order_quantity, " +
- *           "o.item AS order_item, " + 
- *           "i.name AS item_name, " +
- *         "FROM Order o, Item i " +
- *         "WHERE (order_quantity > 25) AND (order_item = i.id)",
- *       "OrderResults");
- *
- *   @SqlResultSetMapping(name="OrderResults",
- *       entities={
- *           @EntityResult(entityClass=com.acme.Order.class, fields={
- *               @FieldResult(name="id", column="order_id"),
- *               @FieldResult(name="quantity", column="order_quantity"),
- *               @FieldResult(name="item", column="order_item")})},
- *       columns={
- *           @ColumnResult(name="item_name")}
- *       )
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({}) -@Retention(RUNTIME) - -public @interface ColumnResult { - - /** The name of a column in the SELECT clause of a SQL query */ - String name(); -} diff --git a/utils/src/javax/persistence/DiscriminatorColumn.java b/utils/src/javax/persistence/DiscriminatorColumn.java deleted file mode 100644 index 7034df66bfd..00000000000 --- a/utils/src/javax/persistence/DiscriminatorColumn.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static javax.persistence.DiscriminatorType.STRING; - -/** - * Is used to define the discriminator column for the - * {@link InheritanceType#SINGLE_TABLE SINGLE_TABLE} and - * {@link InheritanceType#JOINED JOINED} inheritance mapping strategies. - * - *

The strategy and the discriminator column are only - * specified in the root of an entity class hierarchy or - * subhierarchy in which a different inheritance strategy is applied - * - *

If the DiscriminatorColumn annotation is missing, - * and a discriminator column is required, the name of the - * discriminator column defaults to "DTYPE" and the discriminator - * type to {@link DiscriminatorType#STRING DiscriminatorType.STRING}. - * - *

- *     Example:
- *     @Entity
- *     @Table(name="CUST")
- *     @Inheritance(strategy=SINGLE_TABLE)
- *     @DiscriminatorColumn(name="DISC", discriminatorType=STRING,length=20)
- *     public class Customer { ... }
- *
- *     @Entity
- *     public class ValuedCustomer extends Customer { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE}) -@Retention(RUNTIME) - -public @interface DiscriminatorColumn { - - /** - * (Optional) The name of column to be used for the discriminator. - */ - String name() default "DTYPE"; - - /** - * (Optional) The type of object/column to use as a class discriminator. - * Defaults to {@link DiscriminatorType#STRING DiscriminatorType.STRING}. - */ - DiscriminatorType discriminatorType() default STRING; - - /** - * (Optional) The SQL fragment that is used when generating the DDL - * for the discriminator column. - *

Defaults to the provider-generated SQL to create a column - * of the specified discriminator type. - */ - String columnDefinition() default ""; - - /** - * (Optional) The column length for String-based discriminator types. - * Ignored for other discriminator types. - */ - int length() default 31; -} diff --git a/utils/src/javax/persistence/DiscriminatorType.java b/utils/src/javax/persistence/DiscriminatorType.java deleted file mode 100644 index 7db7dd8af42..00000000000 --- a/utils/src/javax/persistence/DiscriminatorType.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * Defines supported types of the discriminator column. - * - * @since Java Persistence 1.0 - */ -public enum DiscriminatorType { - - /** String as the discriminator type */ - STRING, - - /** Single character as the discriminator type */ - CHAR, - - /** Integer as the discriminator type */ - INTEGER -} diff --git a/utils/src/javax/persistence/DiscriminatorValue.java b/utils/src/javax/persistence/DiscriminatorValue.java deleted file mode 100644 index a090f422acc..00000000000 --- a/utils/src/javax/persistence/DiscriminatorValue.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Is used to specify the value of the discriminator column for - * entities of the given type. The DiscriminatorValue - * annotation can only be specified on a concrete entity - * class. If the DiscriminatorValue annotation is not - * specified and a discriminator column is used, a provider-specific - * function will be used to generate a value representing the - * entity type. If the {@link DiscriminatorType} is {@link - * DiscriminatorType#STRING STRING}, the discriminator value - * default is the entity name. - * - *

The inheritance strategy and the discriminator column - * are only specified in the root of an entity class hierarchy - * or subhierarchy in which a different inheritance strategy is - * applied. The discriminator value, if not defaulted, should be - * specified for each entity class in the hierarchy. - * - *

- *
- *    Example:
- *
- *    @Entity
- *    @Table(name="CUST")
- *    @Inheritance(strategy=SINGLE_TABLE)
- *    @DiscriminatorColumn(name="DISC", discriminatorType=STRING,length=20)
- *    @DiscriminatorValue("CUSTOMER")
- *    public class Customer { ... }
- *
- *    @Entity
- *    @DiscriminatorValue("VCUSTOMER")
- *    public class ValuedCustomer extends Customer { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE}) -@Retention(RUNTIME) - -public @interface DiscriminatorValue { - - /** - * (Optional) The value that indicates that the - * row is an entity of the annotated entity type. - * - *

If the DiscriminatorValue annotation is not - * specified and a discriminator column is used, a provider-specific - * function will be used to generate a value representing the - * entity type. If the DiscriminatorType is {@link - * DiscriminatorType#STRING STRING}, the discriminator value - * default is the entity name. - */ - String value(); -} diff --git a/utils/src/javax/persistence/ElementCollection.java b/utils/src/javax/persistence/ElementCollection.java deleted file mode 100644 index ced47e48e18..00000000000 --- a/utils/src/javax/persistence/ElementCollection.java +++ /dev/null @@ -1,16 +0,0 @@ -package javax.persistence; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target(value = { METHOD, FIELD }) -@Retention(value = RetentionPolicy.RUNTIME) -public @interface ElementCollection { - FetchType fetch() default FetchType.LAZY; - - Class targetClass() default void.class; -} diff --git a/utils/src/javax/persistence/Embeddable.java b/utils/src/javax/persistence/Embeddable.java deleted file mode 100644 index 2a0107e4dfa..00000000000 --- a/utils/src/javax/persistence/Embeddable.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Defines a class whose instances are stored as an intrinsic - * part of an owning entity and share the identity of the entity. - * Each of the persistent properties or fields of the embedded - * object is mapped to the database table for the entity. Only - * {@link Basic}, {@link Column}, {@link Lob}, - * {@link Temporal}, and {@link Enumerated} mapping - * annotations may portably be used to map the persistent fields - * or properties of classes annotated as {@link Embeddable}. - * - *

Note that the {@link Transient} annotation may be used to - * designate the non-persistent state of an embeddable class. - * - * @since Java Persistence 1.0 - */ -@Target({TYPE}) -@Retention(RUNTIME) - -public @interface Embeddable { -} diff --git a/utils/src/javax/persistence/Embedded.java b/utils/src/javax/persistence/Embedded.java deleted file mode 100644 index c683cde768d..00000000000 --- a/utils/src/javax/persistence/Embedded.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Defines a persistent field or property of an entity whose - * value is an instance of an embeddable class. The embeddable - * class must be annotated as {@link Embeddable}. - * - *

- *   Example:
- *
- *   @Embedded
- *   @AttributeOverrides({
- *       @AttributeOverride(name="startDate",
- *           column=@Column("EMP_START")),
- *       @AttributeOverride(name="endDate", column=@Column("EMP_END"))
- *   })
- *   public EmploymentPeriod getEmploymentPeriod() { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface Embedded { -} diff --git a/utils/src/javax/persistence/EmbeddedId.java b/utils/src/javax/persistence/EmbeddedId.java deleted file mode 100644 index 98209cddeca..00000000000 --- a/utils/src/javax/persistence/EmbeddedId.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Is applied to a persistent field or property of an entity - * class or mapped superclass to denote a composite primary - * key that is an embeddable class. The embeddable class - * must be annotated as {@link Embeddable}. - * - *
- *    Example:
- *
- *    @EmbeddedId
- *    protected EmployeePK empPK;
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface EmbeddedId {} diff --git a/utils/src/javax/persistence/Entity.java b/utils/src/javax/persistence/Entity.java deleted file mode 100644 index 55a980a7478..00000000000 --- a/utils/src/javax/persistence/Entity.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Specifies that the class is an entity. This annotation is - * applied to the entity class. - * - * @since Java Persistence 1.0 - */ -@Target(TYPE) -@Retention(RUNTIME) - -public @interface Entity { - - /** The name of an entity. Defaults to the unqualified - * name of the entity class. This name is used to - * refer to the entity in queries. The name must not be - * a reserved literal in the Java Persistence query language. */ - String name() default ""; -} diff --git a/utils/src/javax/persistence/EntityExistsException.java b/utils/src/javax/persistence/EntityExistsException.java deleted file mode 100644 index dd2704f7ad4..00000000000 --- a/utils/src/javax/persistence/EntityExistsException.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * Thrown by the persistence provider when {@link EntityManager#persist(Object) - * EntityManager.persist(Object)} is called and the entity - * already exists. The current transaction, if one is active, - * will be marked for rollback. - * - * @see javax.persistence.EntityManager#persist(Object) - * - * @since Java Persistence 1.0 - */ -@SuppressWarnings("serial") -public class EntityExistsException extends PersistenceException { - - /** - * Constructs a new EntityExistsException exception - * with null as its detail message. - */ - public EntityExistsException() { - super(); - } - - /** - * Constructs a new EntityExistsException exception - * with the specified detail message. - * @param message the detail message. - */ - public EntityExistsException(String message) { - super(message); - } - - /** - * Constructs a new EntityExistsException exception - * with the specified detail message and cause. - * @param message the detail message. - * @param cause the cause. - */ - public EntityExistsException(String message, Throwable cause) { - super(message, cause); - } - - /** - * Constructs a new EntityExistsException exception - * with the specified cause. - * @param cause the cause. - */ - public EntityExistsException(Throwable cause) { - super(cause); - } -}; - diff --git a/utils/src/javax/persistence/EntityListeners.java b/utils/src/javax/persistence/EntityListeners.java deleted file mode 100644 index 934e3f6c8b4..00000000000 --- a/utils/src/javax/persistence/EntityListeners.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Specifies the callback listener classes to be used for an - * entity or mapped superclass. This annotation may be applied - * to an entity class or mapped superclass. - * - * @since Java Persistence 1.0 - */ -@Target({TYPE}) -@Retention(RUNTIME) - -public @interface EntityListeners { - - /** The callback listener classes */ - Class[] value(); -} diff --git a/utils/src/javax/persistence/EntityNotFoundException.java b/utils/src/javax/persistence/EntityNotFoundException.java deleted file mode 100755 index dee489b9e83..00000000000 --- a/utils/src/javax/persistence/EntityNotFoundException.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * Thrown by the persistence provider when an entity reference obtained by - * {@link EntityManager#getReference EntityManager.getReference(Class,Object)} - * is accessed but the entity does not exist. Also thrown when - * {@link EntityManager#refresh EntityManager.refresh(Object)} is called - * and the object no longer exists in the database. The - * current transaction, if one is active, will be marked for rollback. - * - * @see javax.persistence.EntityManager#getReference(Class,Object) - * @see javax.persistence.EntityManager#refresh(Object) - * - * @since Java Persistence 1.0 - */ -@SuppressWarnings("serial") -public class EntityNotFoundException extends PersistenceException { - - /** - * Constructs a new EntityNotFoundException exception - * with null as its detail message. - */ - public EntityNotFoundException() { - super(); - } - - /** - * Constructs a new EntityNotFoundException exception - * with the specified detail message. - * @param message the detail message. - */ - public EntityNotFoundException(String message) { - super(message); - } - -}; diff --git a/utils/src/javax/persistence/EntityResult.java b/utils/src/javax/persistence/EntityResult.java deleted file mode 100644 index 0133fe77980..00000000000 --- a/utils/src/javax/persistence/EntityResult.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * References an entity in the SELECT clause of a SQL query. - * If this annotation is used, the SQL statement should select - * all of the columns that are mapped to the entity object. - * This should include foreign key columns to related entities. - * The results obtained when insufficient data is available - * are undefined. - * - *
- *   Example
- *   Query q = em.createNativeQuery(
- *       "SELECT o.id, o.quantity, o.item, i.id, i.name, i.description "+
- *           "FROM Order o, Item i " +
- *           "WHERE (o.quantity > 25) AND (o.item = i.id)",
- *       "OrderItemResults");
- *   @SqlResultSetMapping(name="OrderItemResults",
- *       entities={
- *           @EntityResult(entityClass=com.acme.Order.class),
- *           @EntityResult(entityClass=com.acme.Item.class)
- *   })
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({}) -@Retention(RUNTIME) - -public @interface EntityResult { - - /** The class of the result */ - Class entityClass(); - - /** - * Maps the columns specified in the SELECT list of the - * query to the properties or fields of the entity class. - */ - FieldResult[] fields() default {}; - - /** - * Specifies the column name (or alias) of the column in - * the SELECT list that is used to determine the type of - * the entity instance. - */ - String discriminatorColumn() default ""; -} diff --git a/utils/src/javax/persistence/EntityTransaction.java b/utils/src/javax/persistence/EntityTransaction.java deleted file mode 100755 index 26629f27e70..00000000000 --- a/utils/src/javax/persistence/EntityTransaction.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * The EntityTransaction interface is used to control - * resource transactions on resource-local entity managers. The - * {@link EntityManager#getTransaction EntityManager.getTransaction()} - * method returns the EntityTransaction interface. - * - * @since Java Persistence 1.0 - */ -public interface EntityTransaction { - /** - * Start the resource transaction. - * @throws IllegalStateException if {@link #isActive()} is true. - */ - public void begin(); - - /** - * Commit the current transaction, writing any unflushed - * changes to the database. - * @throws IllegalStateException if {@link #isActive()} is false. - * @throws RollbackException if the commit fails. - */ - public void commit(); - - /** - * Roll back the current transaction - * @throws IllegalStateException if {@link #isActive()} is false. - * @throws PersistenceException if an unexpected error - * condition is encountered. - */ - public void rollback(); - - /** - * Mark the current transaction so that the only possible - * outcome of the transaction is for the transaction to be - * rolled back. - * @throws IllegalStateException if {@link #isActive()} is false. - */ - public void setRollbackOnly(); - - /** - * Determine whether the current transaction has been marked - * for rollback. - * @throws IllegalStateException if {@link #isActive()} is false. - */ - public boolean getRollbackOnly(); - - /** - * Indicate whether a transaction is in progress. - * @throws PersistenceException if an unexpected error - * condition is encountered. - */ - public boolean isActive(); -} diff --git a/utils/src/javax/persistence/EnumType.java b/utils/src/javax/persistence/EnumType.java deleted file mode 100644 index b8e3def5847..00000000000 --- a/utils/src/javax/persistence/EnumType.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * Defines mapping for the enumerated types. - * The constants of this enumerated type specify how persistent - * property or field should be persisted as a enumerated type. - * - * @since Java Persistence 1.0 - */ -public enum EnumType { - /** Persist enumerated type property or field as an integer */ - ORDINAL, - - /** Persist enumerated type property or field as a string */ - STRING -} diff --git a/utils/src/javax/persistence/Enumerated.java b/utils/src/javax/persistence/Enumerated.java deleted file mode 100644 index 546fc93d0c2..00000000000 --- a/utils/src/javax/persistence/Enumerated.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static javax.persistence.EnumType.ORDINAL; - -/** - * Specifies that a persistent property or field should be - * persisted as a enumerated type. It may be used in conjunction - * with the {@link Basic} annotation. - * - *
- *   Example:
- *
- *   public enum EmployeeStatus {FULL_TIME, PART_TIME, CONTRACT}
- *
- *   public enum SalaryRate {JUNIOR, SENIOR, MANAGER, EXECUTIVE}
- *
- *   @Entity public class Employee {
- *       public EmployeeStatus getStatus() {...}
- *       @Enumerated(STRING)
- *       public SalaryRate getPayScale() {...}
- *       ...
- *   }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface Enumerated { - - /** (Optional) The type used in mapping an enum type. */ - EnumType value() default ORDINAL; -} diff --git a/utils/src/javax/persistence/FetchType.java b/utils/src/javax/persistence/FetchType.java deleted file mode 100644 index dbc2add5fcd..00000000000 --- a/utils/src/javax/persistence/FetchType.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * Defines strategies for fetching data from the database. - * The EAGER strategy is a requirement on the persistence - * provider runtime that data must be eagerly fetched. The - * LAZY strategy is a hint to the persistence provider - * runtime that data should be fetched lazily when it is - * first accessed. The implementation is permitted to eagerly - * fetch data for which the LAZY strategy hint has been - * specified. In particular, lazy fetching might only be - * available for {@link Basic} mappings for which property-based - * access is used. - * - *
- *   Example:
- *   @Basic(fetch=LAZY)
- *   protected String getName() { return name; }
- * 
- * - * @since Java Persistence 1.0 - */ -public enum FetchType { - - /** Defines that data can be lazily fetched */ - LAZY, - - /** Defines that data must be eagerly fetched */ - EAGER -} diff --git a/utils/src/javax/persistence/FieldResult.java b/utils/src/javax/persistence/FieldResult.java deleted file mode 100644 index 54bb1735af6..00000000000 --- a/utils/src/javax/persistence/FieldResult.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Is used to map the columns specified in the SELECT list - * of the query to the properties or fields of the entity class. - * - *
- *
- * Example:
- *   Query q = em.createNativeQuery(
- *       "SELECT o.id AS order_id, " +
- *           "o.quantity AS order_quantity, " +
- *           "o.item AS order_item, " +
- *         "FROM Order o, Item i " +
- *         "WHERE (order_quantity > 25) AND (order_item = i.id)",
- *       "OrderResults");
- *
- *   @SqlResultSetMapping(name="OrderResults",
- *       entities={
- *           @EntityResult(entityClass=com.acme.Order.class, fields={
- *               @FieldResult(name="id", column="order_id"),
- *               @FieldResult(name="quantity", column="order_quantity"),
- *               @FieldResult(name="item", column="order_item")})
- *       })
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({}) -@Retention(RUNTIME) - -public @interface FieldResult { - - /** Name of the persistent field or property of the class. */ - String name(); - - /** - * Name of the column in the SELECT clause - i.e., column - * aliases, if applicable. - */ - String column(); -} diff --git a/utils/src/javax/persistence/FlushModeType.java b/utils/src/javax/persistence/FlushModeType.java deleted file mode 100644 index ffc49d53a0a..00000000000 --- a/utils/src/javax/persistence/FlushModeType.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * Flush mode setting. - * - *

When queries are executed within a transaction, if - * FlushModeType.AUTO is set on the {@link Query} - * object, or if the flush mode setting for the persistence context - * is AUTO (the default) and a flush mode setting has - * not been specified for the {@link Query} object, the persistence - * provider is responsible for ensuring that all updates to the state - * of all entities in the persistence context which could potentially - * affect the result of the query are visible to the processing - * of the query. The persistence provider implementation may achieve - * this by flushing those entities to the database or by some other - * means. If FlushModeType.COMMIT is set, the effect - * of updates made to entities in the persistence context upon - * queries is unspecified. - * - *

If there is no transaction active, the persistence provider - * must not flush to the database. - * - * @since Java Persistence 1.0 - */ -public enum FlushModeType { - - /** Flushing must occur only at transaction commit */ - COMMIT, - - /** (Default) Flushing to occur at query execution */ - AUTO -} diff --git a/utils/src/javax/persistence/GeneratedValue.java b/utils/src/javax/persistence/GeneratedValue.java deleted file mode 100644 index b9334ae8cad..00000000000 --- a/utils/src/javax/persistence/GeneratedValue.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static javax.persistence.GenerationType.AUTO; - -/** - * Provides for the specification of generation strategies for - * the values of primary keys. The GeneratedValue - * annotation may be applied to a primary key property or - * field of an entity or mapped superclass in conjunction with - * the {@link Id} annotation. - * - *

- *
- * Example 1:
- *
- *     @Id
- *     @GeneratedValue(strategy=SEQUENCE, generator="CUST_SEQ")
- *     @Column(name="CUST_ID")
- *     public Long getId() { return id; }
- *
- *     Example 2:
- *
- *     @Id
- *     @GeneratedValue(strategy=TABLE, generator="CUST_GEN")
- *     @Column(name="CUST_ID")
- *     Long id;
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface GeneratedValue { - - /** - * (Optional) The primary key generation strategy - * that the persistence provider must use to - * generate the annotated entity primary key. - */ - GenerationType strategy() default AUTO; - - /** - * (Optional) The name of the primary key generator - * to use as specified in the {@link SequenceGenerator} - * or {@link TableGenerator} annotation. - *

Defaults to the id generator supplied by persistence provider. - */ - String generator() default ""; -} diff --git a/utils/src/javax/persistence/GenerationType.java b/utils/src/javax/persistence/GenerationType.java deleted file mode 100644 index 963d627c095..00000000000 --- a/utils/src/javax/persistence/GenerationType.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * Defines the types of primary key generation. - * - * @since Java Persistence 1.0 - */ -public enum GenerationType { - - /** - * Indicates that the persistence provider must assign - * primary keys for the entity using an underlying - * database table to ensure uniqueness. - */ - TABLE, - - /** - * Indicates that the persistence provider must assign - * primary keys for the entity using database sequence column. - */ - SEQUENCE, - - /** - * Indicates that the persistence provider must assign - * primary keys for the entity using database identity column. - */ - IDENTITY, - - /** - * Indicates that the persistence provider should pick an - * appropriate strategy for the particular database. The - * AUTO generation strategy may expect a database - * resource to exist, or it may attempt to create one. A vendor - * may provide documentation on how to create such resources - * in the event that it does not support schema generation - * or cannot create the schema resource at runtime. - */ - AUTO -} diff --git a/utils/src/javax/persistence/Id.java b/utils/src/javax/persistence/Id.java deleted file mode 100644 index 6a9fca0a7d2..00000000000 --- a/utils/src/javax/persistence/Id.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Specifies the primary key property or field of an entity. - * - *

- *   Example:
- *
- *   @Id
- *   public Long getId() { return id; }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface Id {} diff --git a/utils/src/javax/persistence/IdClass.java b/utils/src/javax/persistence/IdClass.java deleted file mode 100644 index 3a5eef715e2..00000000000 --- a/utils/src/javax/persistence/IdClass.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Specifies a composite primary key class that is mapped to - * multiple fields or properties of the entity. - * - *

The names of the fields or properties in the primary key - * class and the primary key fields or properties of the entity - * must correspond and their types must be the same. - * - *

- *
- *   Example:
- *
- *   @IdClass(com.acme.EmployeePK.class)
- *   @Entity
- *   public class Employee {
- *     @Id String empName;
- *     @Id Date birthDay;
- *     ...
- *   }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE}) -@Retention(RUNTIME) - -public @interface IdClass { - - /** Primary key class */ - Class value(); -} diff --git a/utils/src/javax/persistence/Inheritance.java b/utils/src/javax/persistence/Inheritance.java deleted file mode 100644 index abcb4a5475f..00000000000 --- a/utils/src/javax/persistence/Inheritance.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static javax.persistence.InheritanceType.SINGLE_TABLE; - -/** - * Defines the inheritance strategy to be used for an entity class - * hierarchy. It is specified on the entity class that is the root - * of the entity class hierarchy. - * - *
- *
- *   Example:
- *
- *   @Entity
- *   @Inheritance(strategy=JOINED)
- *   public class Customer { ... }
- *
- *   @Entity
- *   public class ValuedCustomer extends Customer { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE}) -@Retention(RUNTIME) - -public @interface Inheritance { - - /** The strategy to be used */ - InheritanceType strategy() default SINGLE_TABLE; -} diff --git a/utils/src/javax/persistence/InheritanceType.java b/utils/src/javax/persistence/InheritanceType.java deleted file mode 100644 index 5c7906ffae1..00000000000 --- a/utils/src/javax/persistence/InheritanceType.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * Defines inheritance strategy options. - * - * @since Java Persistence 1.0 - */ -public enum InheritanceType { - - /** A single table per class hierarchy */ - SINGLE_TABLE, - - /** A table per concrete entity class */ - TABLE_PER_CLASS, - - /** - * A strategy in which fields that are specific to a - * subclass are mapped to a separate table than the fields - * that are common to the parent class, and a join is - * performed to instantiate the subclass. - */ - JOINED -} diff --git a/utils/src/javax/persistence/JoinColumn.java b/utils/src/javax/persistence/JoinColumn.java deleted file mode 100644 index f24be9df571..00000000000 --- a/utils/src/javax/persistence/JoinColumn.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Is used to specify a mapped column for joining an entity association. - * - *
- *   Example:
- *
- *   @ManyToOne
- *   @JoinColumn(name="ADDR_ID")
- *   public Address getAddress() { return address; }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface JoinColumn { - - /** - * (Optional) The name of the foreign key column. - * The table in which it is found depends upon the - * context. If the join is for a OneToOne or Many- - * ToOne mapping, the foreign key column is in the - * table of the source entity. If the join is for a - * ManyToMany, the foreign key is in a join table. - * - * Default (only applies if a single join column is used): - * The concatenation of the following: the name of the - * referencing relationship property or field of the referencing - * entity; "_"; the name of the referenced primary key column. - * If there is no such referencing relationship property or - * field in the entity, the join column name is formed as the - * concatenation of the following: the name of the entity; "_"; - * the name of the referenced primary key column. - */ - String name() default ""; - - /** - * (Optional) The name of the column referenced - * by this foreign key column. When used with - * relationship mappings, the referenced column is - * in the table of the target entity. When used inside - * a JoinTable annotation, the referenced key column - * is in the entity table of the owning entity, or - * inverse entity if the join is part of the inverse join - * definition. - * - * Default (only applies if single join column is being - * used): The same name as the primary key column of the - * referenced table. - */ - String referencedColumnName() default ""; - - /** - * (Optional) Whether the property is a unique key. - * This is a shortcut for the UniqueConstraint annotation - * at the table level and is useful for when the - * unique key constraint is only a single field. It is - * not necessary to explicitly specify this for a join - * column that corresponds to a primary key that is - * part of a foreign key. - */ - boolean unique() default false; - - /** (Optional) Whether the foreign key column is nullable. */ - boolean nullable() default true; - - /** - * (Optional) Whether the column is included in - * SQL INSERT statements generated by the persistence - * provider. - */ - boolean insertable() default true; - - /** - * (Optional) Whether the column is included in - * SQL UPDATE statements generated by the persistence - * provider. - */ - boolean updatable() default true; - - /** - * (Optional) The SQL fragment that is used when - * generating the DDL for the column. - *

Defaults to the generated SQL for the column. - */ - String columnDefinition() default ""; - - /** - * (Optional) The name of the table that contains - * the column. If a table is not specified, the column - * is assumed to be in the primary table of the - * applicable entity. - */ - String table() default ""; -} diff --git a/utils/src/javax/persistence/JoinColumns.java b/utils/src/javax/persistence/JoinColumns.java deleted file mode 100644 index e1f85f4f637..00000000000 --- a/utils/src/javax/persistence/JoinColumns.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Defines mapping for the composite foreign keys. This annotation - * groups {@link JoinColumn} annotations for the same relationship. - * - *

When the JoinColumns annotation is used, - * both the {@link JoinColumn#name name} and the {@link - * JoinColumn#referencedColumnName referencedColumnName} elements - * must be specified in each such {@link JoinColumn} annotation. - * - *

- *
- *    Example:
- *    @ManyToOne
- *    @JoinColumns({
- *        @JoinColumn(name="ADDR_ID", referencedColumnName="ID"),
- *        @JoinColumn(name="ADDR_ZIP", referencedColumnName="ZIP")
- *    })
- *    public Address getAddress() { return address; }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface JoinColumns { - JoinColumn[] value(); -} diff --git a/utils/src/javax/persistence/JoinTable.java b/utils/src/javax/persistence/JoinTable.java deleted file mode 100644 index 888a7ec6a7e..00000000000 --- a/utils/src/javax/persistence/JoinTable.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation is used in the mapping of associations. It - * is specified on the owning side of a many-to-many association, - * or in a unidirectional one-to-many association. - * - *

If the JoinTable annotation is missing, the - * default values of the annotation elements apply. The name - * of the join table is assumed to be the table names of the - * associated primary tables concatenated together (owning side - * first) using an underscore. - * - *

- *
- *    Example:
- *    @JoinTable(
- *    name="CUST_PHONE",
- *    joinColumns=
- *        @JoinColumn(name="CUST_ID", referencedColumnName="ID"),
- *    inverseJoinColumns=
- *        @JoinColumn(name="PHONE_ID", referencedColumnName="ID")
- *    )
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface JoinTable { - - /** - * (Optional) The name of the join table. - * - *

Defaults to the concatenated names of - * the two associated primary entity tables, - * separated by an underscore. - */ - String name() default ""; - - /** (Optional) The catalog of the table. - *

Defaults to the default catalog. - */ - String catalog() default ""; - - /** (Optional) The schema of the table. - *

Defaults to the default schema for user. - */ - String schema() default ""; - - /** - * (Optional) The foreign key columns - * of the join table which reference the - * primary table of the entity owning the - * association (i.e. the owning side of - * the association). - * - *

Uses the same defaults as for {@link JoinColumn}. - */ - JoinColumn[] joinColumns() default {}; - - /** - * (Optional) The foreign key columns - * of the join table which reference the - * primary table of the entity that does - * not own the association (i.e. the - * inverse side of the association). - * - *

Uses the same defaults as for {@link JoinColumn}. - */ - JoinColumn[] inverseJoinColumns() default {}; - - /** - * (Optional) Unique constraints that are - * to be placed on the table. These are - * only used if table generation is in effect. - *

Defaults to no additional constraints. - */ - UniqueConstraint[] uniqueConstraints() default {}; -} diff --git a/utils/src/javax/persistence/Lob.java b/utils/src/javax/persistence/Lob.java deleted file mode 100644 index 7fca155b00e..00000000000 --- a/utils/src/javax/persistence/Lob.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Specifies that a persistent property or field should be persisted - * as a large object to a database-supported large object type. - * The Lob annotation may be used in conjunction - * with the {@link Basic} annotation. A Lob may be - * either a binary or character type. - * - *

The Lob type is inferred from the type of the - * persistent field or property, and except for string and - * character-based types defaults to Blob. - *

- *
- *   Example:
- *
- *   @Lob @Basic(fetch=LAZY)
- *   @Column(name="REPORT")
- *   protected String report;
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface Lob { -} diff --git a/utils/src/javax/persistence/LockModeType.java b/utils/src/javax/persistence/LockModeType.java deleted file mode 100644 index 3b9dd68f928..00000000000 --- a/utils/src/javax/persistence/LockModeType.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * Lock modes that can be specified by means of the - * {@link EntityManager#lock EntityManager.lock()} method. - * - *

The semantics of requesting locks of type - * {@link LockModeType#READ LockModeType.READ} and {@link - * LockModeType#WRITE LockModeType.WRITE} are the following. - * - *

If transaction T1 calls lock(entity, {@link - * LockModeType#READ LockModeType.READ}) on a versioned object, - * the entity manager must ensure that neither of the following - * phenomena can occur: - *

    - *
  • P1 (Dirty read): Transaction T1 modifies a row. - * Another transaction T2 then reads that row and obtains - * the modified value, before T1 has committed or rolled back. - * Transaction T2 eventually commits successfully; it does not - * matter whether T1 commits or rolls back and whether it does - * so before or after T2 commits. - *
  • - *
  • P2 (Non-repeatable read): Transaction T1 reads a row. - * Another transaction T2 then modifies or deletes that row, - * before T1 has committed. Both transactions eventually commit - * successfully. - * - *
- * - *

Lock modes must always prevent the phenomena P1 and P2. - * - *

In addition, calling lock(entity, LockModeType.WRITE) on - * a versioned object, will also force an update (increment) to - * the entity's version column. - * - *

The persistence implementation is not required to support - * calling {@link EntityManager#lock EntityManager.lock()} on a - * non-versioned object. When it cannot support a such lock call, - * it must throw the {@link PersistenceException}. - * - * - * @since Java Persistence 1.0 - */ -public enum LockModeType { - - /** Read lock */ - READ, - - /** Write lock */ - WRITE -} diff --git a/utils/src/javax/persistence/ManyToMany.java b/utils/src/javax/persistence/ManyToMany.java deleted file mode 100644 index 4a681f115e6..00000000000 --- a/utils/src/javax/persistence/ManyToMany.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import javax.persistence.CascadeType; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static javax.persistence.FetchType.LAZY; - -/** - * Defines a many-valued association with many-to-many multiplicity. - * If the Collection is defined using generics to specify the element - * type, the associated target entity class does not need to be - * specified; otherwise it must be specified. - * - *

Every many-to-many association has two sides, the owning - * side and the non-owning, or inverse, side. The join table is - * specified on the owning side. If the association is bidirectional, - * either side may be designated as the owning side. - * - *

The same annotation elements for the {@link OneToMany} - * annotation apply to the ManyToMany annotation. - * - *

- *
- *    Example 1:
- *
- *    In Customer class:
- *
- *    @ManyToMany
- *    @JoinTable(name="CUST_PHONES")
- *    public Set getPhones() { return phones; }
- *
- *    In PhoneNumber class:
- *
- *    @ManyToMany(mappedBy="phones")
- *    public Set getCustomers() { return customers; }
- *
- *    Example 2:
- *
- *    In Customer class:
- *
- *    @ManyToMany(targetEntity=com.acme.PhoneNumber.class)
- *    public Set getPhones() { return phones; }
- *
- *    In PhoneNumber class:
- *
- *    @ManyToMany(targetEntity=com.acme.Customer.class, mappedBy="phones")
- *    public Set getCustomers() { return customers; }
- *
- *    Example 3:
- *
- *    In Customer class:
- *
- *    @ManyToMany
- *    @JoinTable(name="CUST_PHONE",
- *        joinColumns=
- *            @JoinColumn(name="CUST_ID", referencedColumnName="ID"),
- *        inverseJoinColumns=
- *            @JoinColumn(name="PHONE_ID", referencedColumnName="ID")
- *        )
- *    public Set getPhones() { return phones; }
- *
- *    In PhoneNumberClass:
- *
- *    @ManyToMany(mappedBy="phones")
- *    public Set getCustomers() { return customers; }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface ManyToMany { - - /** - * (Optional) The entity class that is the target - * of the association. Optional only if the collection - * property is defined using Java generics. - * Must be specified otherwise. - * - *

Defaults to the parameterized type of - * the collection when defined using generics. - */ - Class targetEntity() default void.class; - - /** - * (Optional) The operations that must be cascaded to - * the target of the association. - *

Defaults to no operations being cascaded. - */ - CascadeType[] cascade() default {}; - - /** (Optional) Whether the association should be - * lazily loaded or must be eagerly fetched. The - * {@link FetchType#EAGER EAGER} strategy is a - * requirement on the persistenceprovider runtime - * that the associatedentities must be eagerly fetched. - * The {@link FetchType#LAZY LAZY} strategy is a hint - * to the persistence provider runtime. - */ - FetchType fetch() default LAZY; - - /** - * The field that owns the relationship. Required unless - * the relationship is unidirectional. - */ - String mappedBy() default ""; -} diff --git a/utils/src/javax/persistence/ManyToOne.java b/utils/src/javax/persistence/ManyToOne.java deleted file mode 100644 index fb5f4fa1925..00000000000 --- a/utils/src/javax/persistence/ManyToOne.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import javax.persistence.CascadeType; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static javax.persistence.FetchType.EAGER; - -/** - * This annotation defines a single-valued association to another - * entity class that has many-to-one multiplicity. It is not normally - * necessary to specify the target entity explicitly since it can - * usually be inferred from the type of the object being referenced. - * - *

- *
- *     Example:
- *
- *     @ManyToOne(optional=false) 
- *     @JoinColumn(name="CUST_ID", nullable=false, updatable=false)
- *     public Customer getCustomer() { return customer; }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface ManyToOne { - - /** - * (Optional) The entity class that is the target of - * the association. - * - *

Defaults to the type of the field or property - * that stores the association. - */ - Class targetEntity() default void.class; - - /** - * (Optional) The operations that must be cascaded to - * the target of the association. - * - *

By default no operations are cascaded. - */ - CascadeType[] cascade() default {}; - - /** - * (Optional) Whether the association should be lazily - * loaded or must be eagerly fetched. The {@link FetchType#EAGER EAGER} - * strategy is a requirement on the persistence provider runtime that - * the associated entity must be eagerly fetched. The {@link FetchType#LAZY - * LAZY} strategy is a hint to the persistence provider runtime. - */ - FetchType fetch() default EAGER; - - /** - * (Optional) Whether the association is optional. If set - * to false then a non-null relationship must always exist. - */ - boolean optional() default true; -} diff --git a/utils/src/javax/persistence/MapKey.java b/utils/src/javax/persistence/MapKey.java deleted file mode 100644 index 0977f598fbb..00000000000 --- a/utils/src/javax/persistence/MapKey.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Is used to specify the map key for associations of type - * {@link java.util.Map}. - * - *

If a persistent field or property other than the primary - * key is used as a map key then it is expected to have a - * uniqueness constraint associated with it. - * - *

- *
- *    Example 1:
- *
- *    @Entity
- *    public class Department {
- *        ...
- *        @OneToMany(mappedBy="department")
- *        @MapKey(name="empId")
- *        public Map getEmployees() {... }
- *        ...
- *    }
- *
- *    @Entity
- *    public class Employee {
- *        ...
- *        @Id Integer getEmpid() { ... }
- *        @ManyToOne
- *        @JoinColumn(name="dept_id")
- *        public Department getDepartment() { ... }
- *        ...
- *    }
- *
- *    Example 2:
- *
- *    @Entity
- *        public class Department {
- *        ...
- *        @OneToMany(mappedBy="department")
- *        @MapKey(name="empPK")
- *        public Map getEmployees() {... }
- *        ...
- *    }
- *
- *    @Entity
- *        public class Employee {
- *        @EmbeddedId public EmployeePK getEmpPK() { ... }
- *        ...
- *        @ManyToOne
- *        @JoinColumn(name="dept_id")
- *        public Department getDepartment() { ... }
- *        ...
- *    }
- *
- *    @Embeddable
- *    public class EmployeePK {
- *        String name;
- *        Date bday;
- *    }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface MapKey { - - /** - * The name of the persistent field or property of the - * associated entity that is used as the map key. If the - * name element is not specified, the primary key of the - * associated entity is used as the map key. If the - * primary key is a composite primary key and is mapped - * as {@link IdClass}, an instance of the primary key - * class is used as the key. - */ - String name() default ""; -} diff --git a/utils/src/javax/persistence/MappedSuperclass.java b/utils/src/javax/persistence/MappedSuperclass.java deleted file mode 100644 index 0dda69c055b..00000000000 --- a/utils/src/javax/persistence/MappedSuperclass.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Designates a class whose mapping information is applied - * to the entities that inherit from it. A mapped superclass - * has no separate table defined for it. - * - *

A class designated with the MappedSuperclass - * annotation can be mapped in the same way as an entity except that the - * mappings will apply only to its subclasses since no table - * exists for the mapped superclass itself. When applied to the - * subclasses the inherited mappings will apply in the context - * of the subclass tables. Mapping information may be overridden - * in such subclasses by using the {@link AttributeOverride} and - * {@link AssociationOverride} annotations or corresponding XML elements. - * - *

- *    Example: Concrete class as a mapped superclass
- *
- *    @MappedSuperclass
- *    public class Employee {
- *    
- *        @Id protected Integer empId;
- *        @Version protected Integer version;
- *        @ManyToOne @JoinColumn(name="ADDR")
- *        protected Address address;
- *    
- *        public Integer getEmpId() { ... }
- *        public void setEmpId(Integer id) { ... }
- *        public Address getAddress() { ... }
- *        public void setAddress(Address addr) { ... }
- *    }
- *    
- *    // Default table is FTEMPLOYEE table
- *    @Entity
- *    public class FTEmployee extends Employee {
- *    
- *        // Inherited empId field mapped to FTEMPLOYEE.EMPID
- *        // Inherited version field mapped to FTEMPLOYEE.VERSION
- *        // Inherited address field mapped to FTEMPLOYEE.ADDR fk
- *        
- *    
- *    // Defaults to FTEMPLOYEE.SALARY
- *    
- *    protected Integer salary;
- *    
- *    
- *    public FTEmployee() {}
- *    
- *    
- *    public Integer getSalary() { ... }
- *    
- *    public void setSalary(Integer salary) { ... }
- *    }
- *    
- *    @Entity @Table(name="PT_EMP")
- *    @AssociationOverride(name="address", 
- *    
- *    
- *    joincolumns=@JoinColumn(name="ADDR_ID"))
- *    public class PartTimeEmployee extends Employee {
- *    
- *        // Inherited empId field mapped to PT_EMP.EMPID
- *        // Inherited version field mapped to PT_EMP.VERSION
- *        // address field mapping overridden to PT_EMP.ADDR_ID fk
- *        @Column(name="WAGE")
- *        protected Float hourlyWage;
- *    
- *        public PartTimeEmployee() {}
- *    
- *        public Float getHourlyWage() { ... }
- *        public void setHourlyWage(Float wage) { ... }
- *    }
- *
- *    Example: Non-entity superclass
- *
- *    public class Cart {
- *    
- *        // This state is transient
- *        Integer operationCount;
- *    
- *        public Cart() { operationCount = 0; }
- *        public Integer getOperationCount() { return operationCount; }
- *        public void incrementOperationCount() { operationCount++; }
- *    }
- *    
- *    @Entity
- *    public class ShoppingCart extends Cart {
- *    
- *        Collection items = new Vector();
- *    
- *        public ShoppingCart() { super(); }
- *    
- *    
- *    ...
- *    
- *        @OneToMany
- *        public Collection getItems() { return items; }
- *        public void addItem(Item item) {
- *            items.add(item);
- *            incrementOperationCount();
- *        }
- *    }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE}) -@Retention(RUNTIME) - -public @interface MappedSuperclass { -} diff --git a/utils/src/javax/persistence/OneToMany.java b/utils/src/javax/persistence/OneToMany.java deleted file mode 100644 index 5c2674ccdf5..00000000000 --- a/utils/src/javax/persistence/OneToMany.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import javax.persistence.CascadeType; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static javax.persistence.FetchType.LAZY; - -/** - * Defines a many-valued association with one-to-many multiplicity. - * - *

If the collection is defined using generics to specify the - * element type, the associated target entity type need not be - * specified; otherwise the target entity class must be specified. - * - *

- *
- *    Example 1: One-to-Many association using generics
- *
- *    In Customer class:
- *
- *    @OneToMany(cascade=ALL, mappedBy="customer")
- *    public Set getOrders() { return orders; }
- *
- *    In Order class:
- *
- *    @ManyToOne
- *    @JoinColumn(name="CUST_ID", nullable=false)
- *    public Customer getCustomer() { return customer; }
- *
- *    Example 2: One-to-Many association without using generics
- *
- *    In Customer class:
- *
- *    @OneToMany(targetEntity=com.acme.Order.class, cascade=ALL,
- *            mappedBy="customer")
- *    public Set getOrders() { return orders; }
- *
- *    In Order class:
- *
- *    @ManyToOne
- *    @JoinColumn(name="CUST_ID", nullable=false)
- *    public Customer getCustomer() { return customer; }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface OneToMany { - - /** - * (Optional) The entity class that is the target - * of the association. Optional only if the collection - * property is defined using Java generics. - * Must be specified otherwise. - * - *

Defaults to the parameterized type of - * the collection when defined using generics. - */ - Class targetEntity() default void.class; - - /** - * (Optional) The operations that must be cascaded to - * the target of the association. - *

Defaults to no operations being cascaded. - */ - CascadeType[] cascade() default {}; - - /** (Optional) Whether the association should be - * lazily loaded or must be eagerly fetched. The - * {@link FetchType#EAGER EAGER} strategy is a - * requirement on the persistenceprovider runtime - * that the associatedentities must be eagerly fetched. - * The {@link FetchType#LAZY LAZY} strategy is a hint - * to the persistence provider runtime. - */ - FetchType fetch() default LAZY; - - /** - * The field that owns the relationship. Required unless - * the relationship is unidirectional. - */ - String mappedBy() default ""; -} diff --git a/utils/src/javax/persistence/OneToOne.java b/utils/src/javax/persistence/OneToOne.java deleted file mode 100644 index 59f1c3f4cf0..00000000000 --- a/utils/src/javax/persistence/OneToOne.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import javax.persistence.CascadeType; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static javax.persistence.FetchType.EAGER; - -/** - * This annotation defines a single-valued association to - * another entity that has one-to-one multiplicity. It is not - * normally necessary to specify the associated target entity - * explicitly since it can usually be inferred from the type - * of the object being referenced. - * - *

- *    Example 1: One-to-one association that maps a foreign key column
- *
- *    On Customer class:
- *
- *    @OneToOne(optional=false)
- *    @JoinColumn(
- *    	name="CUSTREC_ID", unique=true, nullable=false, updatable=false)
- *    public CustomerRecord getCustomerRecord() { return customerRecord; }
- *
- *    On CustomerRecord class:
- *
- *    @OneToOne(optional=false, mappedBy="customerRecord")
- *    public Customer getCustomer() { return customer; }
- *
- *    Example 2: One-to-one association that assumes both the source and target share the same primary key values. 
- *
- *    On Employee class:
- *
- *    @Entity
- *    public class Employee {
- *    	@Id Integer id;
- *    
- *    	@OneToOne @PrimaryKeyJoinColumn
- *    	EmployeeInfo info;
- *    	...
- *    }
- *
- *    On EmployeeInfo class:
- *
- *    @Entity
- *    public class EmployeeInfo {
- *    	@Id Integer id;
- *    	...
- *    }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface OneToOne { - - /** - * (Optional) The entity class that is the target of - * the association. - * - *

Defaults to the type of the field or property - * that stores the association. - */ - Class targetEntity() default void.class; - - /** - * (Optional) The operations that must be cascaded to - * the target of the association. - * - *

By default no operations are cascaded. - */ - CascadeType[] cascade() default {}; - - /** - * (Optional) Whether the association should be lazily - * loaded or must be eagerly fetched. The {@link FetchType#EAGER EAGER} - * strategy is a requirement on the persistence provider runtime that - * the associated entity must be eagerly fetched. The {@link FetchType#LAZY - * LAZY} strategy is a hint to the persistence provider runtime. - */ - FetchType fetch() default EAGER; - - /** - * (Optional) Whether the association is optional. If set - * to false then a non-null relationship must always exist. - */ - boolean optional() default true; - - /** (Optional) The field that owns the relationship. This - * element is only specified on the inverse (non-owning) - * side of the association. - */ - String mappedBy() default ""; -} diff --git a/utils/src/javax/persistence/OrderBy.java b/utils/src/javax/persistence/OrderBy.java deleted file mode 100644 index 5d7692ed5bc..00000000000 --- a/utils/src/javax/persistence/OrderBy.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation specifies the ordering of the elements of a - * collection valued association at the point when the association - * is retrieved. - * - *

The syntax of the value ordering element is an - * orderby_list, as follows: - * - *

- *    orderby_list::= orderby_item [,orderby_item]*
- *    orderby_item::= property_or_field_name [ASC | DESC]
- * 
- * - *

If ASC or DESC is not specified, - * ASC (ascending order) is assumed. - * - *

If the ordering element is not specified, ordering by - * the primary key of the associated entity is assumed. - * - *

The property or field name must correspond to that of a - * persistent property or field of the associated class. The - * properties or fields used in the ordering must correspond to - * columns for which comparison operators are supported. - * - *

- *    Example:
- *    
- *    @Entity public class Course {
- *     ...
- *     @ManyToMany
- *     @OrderBy("lastname ASC")
- *     public List getStudents() {...};
- *     ...
- *    }
- *    
- *    @Entity public class Student {
- *      ...
- *      @ManyToMany(mappedBy="students")
- *      @OrderBy // PK is assumed
- *      public List getCourses() {...};
- *      ...
- *    }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface OrderBy { - - /** - * An orderby_list, specified as follows: - * - *
-    *    orderby_list::= orderby_item [,orderby_item]*
-    *    orderby_item::= property_or_field_name [ASC | DESC]
-    * 
- * - *

If ASC or DESC is not specified, - * ASC (ascending order) is assumed. - * - *

If the ordering element is not specified, ordering by - * the primary key of the associated entity is assumed. - */ - String value() default ""; -} diff --git a/utils/src/javax/persistence/PersistenceException.java b/utils/src/javax/persistence/PersistenceException.java deleted file mode 100644 index 7027e9f659a..00000000000 --- a/utils/src/javax/persistence/PersistenceException.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - - -/** - * Thrown by the persistence provider when a problem occurs. - * All instances of PersistenceException except for instances of - * {@link NoResultException} and {@link NonUniqueResultException} will cause - * the current transaction, if one is active, to be marked for rollback. - * - * @since Java Persistence 1.0 - */ -@SuppressWarnings("serial") -public class PersistenceException extends RuntimeException { - - /** - * Constructs a new PersistenceException exception - * with null as its detail message. - */ - public PersistenceException() { - super(); - } - - /** - * Constructs a new PersistenceException exception - * with the specified detail message. - * @param message the detail message. - */ - public PersistenceException(String message) { - super(message); - } - - /** - * Constructs a new PersistenceException exception - * with the specified detail message and cause. - * @param message the detail message. - * @param cause the cause. - */ - public PersistenceException(String message, Throwable cause) { - super(message, cause); - } - - /** - * Constructs a new PersistenceException exception - * with the specified cause. - * @param cause the cause. - */ - public PersistenceException(Throwable cause) { - super(cause); - } -}; - diff --git a/utils/src/javax/persistence/PostLoad.java b/utils/src/javax/persistence/PostLoad.java deleted file mode 100644 index 1960f2d1a69..00000000000 --- a/utils/src/javax/persistence/PostLoad.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Is used to specify callback methods for the corresponding - * lifecycle event. This annotation may be applied to methods - * of an entity class, a mapped superclass, or a callback - * listener class. - * - * @since Java Persistence 1.0 - */ -@Target({METHOD}) -@Retention(RUNTIME) - -public @interface PostLoad {} diff --git a/utils/src/javax/persistence/PostPersist.java b/utils/src/javax/persistence/PostPersist.java deleted file mode 100644 index c6682b4761a..00000000000 --- a/utils/src/javax/persistence/PostPersist.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Is used to specify callback methods for the corresponding - * lifecycle event. This annotation may be applied to methods - * of an entity class, a mapped superclass, or a callback - * listener class. - * - * @since Java Persistence 1.0 - */ -@Target({METHOD}) -@Retention(RUNTIME) - -public @interface PostPersist {} diff --git a/utils/src/javax/persistence/PostRemove.java b/utils/src/javax/persistence/PostRemove.java deleted file mode 100644 index 36e56993e02..00000000000 --- a/utils/src/javax/persistence/PostRemove.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Is used to specify callback methods for the corresponding - * lifecycle event. This annotation may be applied to methods - * of an entity class, a mapped superclass, or a callback - * listener class. - * - * @since Java Persistence 1.0 - */ -@Target({METHOD}) -@Retention(RUNTIME) - -public @interface PostRemove {} diff --git a/utils/src/javax/persistence/PostUpdate.java b/utils/src/javax/persistence/PostUpdate.java deleted file mode 100644 index 9235a5eb44e..00000000000 --- a/utils/src/javax/persistence/PostUpdate.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Is used to specify callback methods for the corresponding - * lifecycle event. This annotation may be applied to methods - * of an entity class, a mapped superclass, or a callback - * listener class. - * - * @since Java Persistence 1.0 - */ -@Target({METHOD}) -@Retention(RUNTIME) - -public @interface PostUpdate {} diff --git a/utils/src/javax/persistence/PrimaryKeyJoinColumn.java b/utils/src/javax/persistence/PrimaryKeyJoinColumn.java deleted file mode 100644 index f4bbb657a96..00000000000 --- a/utils/src/javax/persistence/PrimaryKeyJoinColumn.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation specifies a primary key column that is used - * as a foreign key to join to another table. - * - *

It is used to join the primary table of an entity subclass - * in the {@link InheritanceType#JOINED JOINED} mapping strategy - * to the primary table of its superclass; it is used within a - * {@link SecondaryTable} annotation to join a secondary table - * to a primary table; and it may be used in a {@link OneToOne} - * mapping in which the primary key of the referencing entity - * is used as a foreign key to the referenced entity. - * - *

If no PrimaryKeyJoinColumn annotation is - * specified for a subclass in the {@link InheritanceType#JOINED - * JOINED} mapping strategy, the foreign key columns are assumed - * to have the same names as the primary key columns of the - * primary table of the superclass - * - *

- *
- *    Example: Customer and ValuedCustomer subclass
- *
- *    @Entity
- *    @Table(name="CUST")
- *    @Inheritance(strategy=JOINED)
- *    @DiscriminatorValue("CUST")
- *    public class Customer { ... }
- *    
- *    @Entity
- *    @Table(name="VCUST")
- *    @DiscriminatorValue("VCUST")
- *    @PrimaryKeyJoinColumn(name="CUST_ID")
- *    public class ValuedCustomer extends Customer { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE, METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface PrimaryKeyJoinColumn { - - /** - * The name of the primary key column of the current table. - *

Defaults to the same name as the primary key column - * of the primary table of the superclass ({@link - * InheritanceType#JOINED JOINED} mapping strategy); the same - * name as the primary key column of the primary table - * ({@link SecondaryTable} mapping); or the same name as the - * primary key column for the table for the referencing entity - * ({@link OneToOne} mapping) - */ - String name() default ""; - - /** - * (Optional) The name of the primary key column of the table - * being joined to. - *

Defaults to the same name as the primary key column - * of the primary table of the superclass ({@link - * InheritanceType#JOINED JOINED} mapping strategy); the same - * name as the primary key column of the primary table - * ({@link SecondaryTable} mapping); or the same name as the - * primary key column for the table for the referencing entity - * ({@link OneToOne} mapping) - */ - String referencedColumnName() default ""; - - /** - * (Optional) The SQL fragment that is used when generating the - * DDL for the column. This should not be specified for a - * {@link OneToOne} primary key association. - *

Defaults to the generated SQL to create a column of the - * inferred type. - */ - String columnDefinition() default ""; -} diff --git a/utils/src/javax/persistence/PrimaryKeyJoinColumns.java b/utils/src/javax/persistence/PrimaryKeyJoinColumns.java deleted file mode 100644 index 1d418e48091..00000000000 --- a/utils/src/javax/persistence/PrimaryKeyJoinColumns.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation groups {@link PrimaryKeyJoinColumn} annotations. - * It is used to map composite foreign keys. - * - *

- *    Example 1: ValuedCustomer subclass
- *
- *    @Entity
- *    @Table(name="VCUST")
- *    @DiscriminatorValue("VCUST")
- *    @PrimaryKeyJoinColumns({
- *        @PrimaryKeyJoinColumn(name="CUST_ID", 
- *            referencedColumnName="ID"),
- *        @PrimaryKeyJoinColumn(name="CUST_TYPE",
- *            referencedColumnName="TYPE")
- *    })
- *    public class ValuedCustomer extends Customer { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE, METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface PrimaryKeyJoinColumns { - - /** One or more {@link PrimaryKeyJoinColumn} annotations. */ - PrimaryKeyJoinColumn[] value(); -} diff --git a/utils/src/javax/persistence/SecondaryTable.java b/utils/src/javax/persistence/SecondaryTable.java deleted file mode 100644 index 394252860cd..00000000000 --- a/utils/src/javax/persistence/SecondaryTable.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation is used to specify a secondary table for - * the annotated entity class. Specifying one or more secondary - * tables indicates that the data for the entity class is stored - * across multiple tables. - * - *

If no SecondaryTable annotation is specified, - * it is assumed that all persistent fields or properties of the - * entity are mapped to the primary table. If no primary key join - * columns are specified, the join columns are assumed to reference - * the primary key columns of the primary table, and have the same - * names and types as the referenced primary key columns of the - * primary table. - * - *

- * Example 1: Single secondary table with a single primary key column.
- *
- *    @Entity
- *    @Table(name="CUSTOMER")
- *    @SecondaryTable(name="CUST_DETAIL", 
- *        pkJoinColumns=@PrimaryKeyJoinColumn(name="CUST_ID"))
- *    public class Customer { ... } 
- *
- *    Example 2: Single secondary table with multiple primary key columns.
- *
- *    @Entity
- *    @Table(name="CUSTOMER")
- *    @SecondaryTable(name="CUST_DETAIL",
- *        pkJoinColumns={
- *            @PrimaryKeyJoinColumn(name="CUST_ID"),
- *            @PrimaryKeyJoinColumn(name="CUST_TYPE")})
- *    public class Customer { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target(TYPE) -@Retention(RUNTIME) - -public @interface SecondaryTable { - - /** (Required) The name of the table. */ - String name(); - - /** (Optional) The catalog of the table. - *

Defaults to the default catalog. - */ - String catalog() default ""; - - /** (Optional) The schema of the table. - *

Defaults to the default schema for user. - */ - String schema() default ""; - - /** - * (Optional) The columns that are used to join with - * the primary table. - *

Defaults to the column(s) of the same name(s) - * as the primary key column(s) in the primary table - */ - PrimaryKeyJoinColumn[] pkJoinColumns() default {}; - - /** - * (Optional) Unique constraints that are to be placed on the - * table. These are typically only used if table generation - * is in effect. These constraints apply in addition to any - * constraints specified by the {@link Column} and {@link JoinColumn} - * annotations and constraints entailed by primary key mappings. - *

Defaults to no additional constraints. - */ - UniqueConstraint[] uniqueConstraints() default {}; - - /** - * (Optional) join type (supports inner, left, right) to use - * for querying data from the joined tables. - */ - String join() default ""; -} diff --git a/utils/src/javax/persistence/SecondaryTables.java b/utils/src/javax/persistence/SecondaryTables.java deleted file mode 100644 index 4cdaf44b8ad..00000000000 --- a/utils/src/javax/persistence/SecondaryTables.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation is used to specify multiple secondary tables - * for an entity. - * - *

- *    Example 1: Multiple secondary tables assuming primary key columns are named the same in all tables.
- *
- *    @Entity
- *    @Table(name="EMPLOYEE")
- *    @SecondaryTables({
- *        @SecondaryTable(name="EMP_DETAIL"),
- *        @SecondaryTable(name="EMP_HIST")
- *    })
- *    public class Employee { ... }
- *    
- *    Example 2: Multiple secondary tables with differently named primary key columns. 
- *
- *    @Entity
- *    @Table(name="EMPLOYEE")
- *    @SecondaryTables({
- *        @SecondaryTable(name="EMP_DETAIL", 
- *            pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPL_ID")),
- *        @SecondaryTable(name="EMP_HIST", 
- *            pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPLOYEE_ID"))
- *    })
- *    public class Employee { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target(TYPE) -@Retention(RUNTIME) - -public @interface SecondaryTables { - - /** The secondary tables for an entity. */ - SecondaryTable[] value(); -} diff --git a/utils/src/javax/persistence/SequenceGenerator.java b/utils/src/javax/persistence/SequenceGenerator.java deleted file mode 100644 index 362740cfa34..00000000000 --- a/utils/src/javax/persistence/SequenceGenerator.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation defines a primary key generator that may - * be referenced by name when a generator element is specified - * for the {@link GeneratedValue} annotation. A sequence generator - * may be specified on the entity class or on the primary key - * field or property. The scope of the generator name is global - * to the persistence unit (across all generator types). - * - *
- *   Example:
- *
- *   @SequenceGenerator(name="EMP_SEQ", allocationSize=25)
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE, METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface SequenceGenerator { - - /** - * (Required) A unique generator name that can be referenced - * by one or more classes to be the generator for primary key - * values. - */ - String name(); - - /** - * (Optional) The name of the database sequence object from - * which to obtain primary key values. - *

Defaults to a provider-chosen value. - */ - String sequenceName() default ""; - - /** - * (Optional) The value from which the sequence object - * is to start generating. - */ - int initialValue() default 1; - - /** - * (Optional) The amount to increment by when allocating - * sequence numbers from the sequence. - */ - int allocationSize() default 50; -} diff --git a/utils/src/javax/persistence/SqlResultSetMapping.java b/utils/src/javax/persistence/SqlResultSetMapping.java deleted file mode 100644 index 8f100c5389a..00000000000 --- a/utils/src/javax/persistence/SqlResultSetMapping.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation is used to specify the mapping of the result - * of a native SQL query. - * - *

- *    Example:
- *
- *    Query q = em.createNativeQuery(
- *        "SELECT o.id AS order_id, " +
- *            "o.quantity AS order_quantity, " +
- *            "o.item AS order_item, " +
- *            "i.name AS item_name, " +
- *        "FROM Order o, Item i " +
- *        "WHERE (order_quantity > 25) AND (order_item = i.id)",
- *    "OrderResults");
- *    
- *    @SqlResultSetMapping(name="OrderResults", 
- *        entities={ 
- *            @EntityResult(entityClass=com.acme.Order.class, fields={
- *                @FieldResult(name="id", column="order_id"),
- *                @FieldResult(name="quantity", column="order_quantity"), 
- *                @FieldResult(name="item", column="order_item")})},
- *        columns={
- *            @ColumnResult(name="item_name")}
- *    )
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE}) -@Retention(RUNTIME) -public @interface SqlResultSetMapping { - - /** - * The name given to the result set mapping, and used to refer - * to it in the methods of the {@link Query} API. - */ - String name(); - - /** Specifies the result set mapping to entities. */ - EntityResult[] entities() default {}; - - /** Specifies the result set mapping to scalar values. */ - ColumnResult[] columns() default {}; -} diff --git a/utils/src/javax/persistence/SqlResultSetMappings.java b/utils/src/javax/persistence/SqlResultSetMappings.java deleted file mode 100644 index 9ebef58457e..00000000000 --- a/utils/src/javax/persistence/SqlResultSetMappings.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation is used to define one or more {@link SqlResultSetMapping}. - * - * @since Java Persistence 1.0 - */ -@Target({TYPE}) -@Retention(RUNTIME) -public @interface SqlResultSetMappings { - - /** One or more {@link SqlResultSetMapping}. */ - SqlResultSetMapping[] value(); -} diff --git a/utils/src/javax/persistence/Table.java b/utils/src/javax/persistence/Table.java deleted file mode 100644 index c79aadbac11..00000000000 --- a/utils/src/javax/persistence/Table.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation specifies the primary table for the annotated - * entity. Additional tables may be specified using {@link SecondaryTable} - * or {@link SecondaryTables} annotation. - * - *

If no Table annotation is specified for an entity - * class, the default values apply. - * - *

- *    Example:
- *
- *    @Entity
- *    @Table(name="CUST", schema="RECORDS")
- *    public class Customer { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target(TYPE) -@Retention(RUNTIME) - -public @interface Table { - - /** - * (Optional) The name of the table. - *

Defaults to the entity name. - */ - String name() default ""; - - /** (Optional) The catalog of the table. - *

Defaults to the default catalog. - */ - String catalog() default ""; - - /** (Optional) The schema of the table. - *

Defaults to the default schema for user. - */ - String schema() default ""; - - /** - * (Optional) Unique constraints that are to be placed on - * the table. These are only used if table generation is in - * effect. These constraints apply in addition to any constraints - * specified by the {@link Column} and {@link JoinColumn} - * annotations and constraints entailed by primary key mappings. - *

Defaults to no additional constraints. - */ - UniqueConstraint[] uniqueConstraints() default {}; -} diff --git a/utils/src/javax/persistence/TableGenerator.java b/utils/src/javax/persistence/TableGenerator.java deleted file mode 100644 index 95ed369855a..00000000000 --- a/utils/src/javax/persistence/TableGenerator.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation defines a primary key generator that may be - * referenced by name when a generator element is specified for - * the {@link GeneratedValue} annotation. A table generator - * may be specified on the entity class or on the primary key - * field or property. The scope of the generator name is global - * to the persistence unit (across all generator types). - * - *

- *    Example 1:
- *    
- *    @Entity public class Employee {
- *        ...
- *        @TableGenerator(
- *            name="empGen", 
- *            table="ID_GEN", 
- *            pkColumnName="GEN_KEY", 
- *            valueColumnName="GEN_VALUE", 
- *            pkColumnValue="EMP_ID", 
- *            allocationSize=1)
- *        @Id
- *        @GeneratedValue(strategy=TABLE, generator="empGen")
- *        public int id;
- *        ...
- *    }
- *    
- *    Example 2:
- *    
- *    @Entity public class Address {
- *        ...
- *        @TableGenerator(
- *            name="addressGen", 
- *            table="ID_GEN", 
- *            pkColumnName="GEN_KEY", 
- *            valueColumnName="GEN_VALUE", 
- *            pkColumnValue="ADDR_ID")
- *        @Id
- *        @GeneratedValue(strategy=TABLE, generator="addressGen")
- *        public int id;
- *        ...
- *    }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({TYPE, METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface TableGenerator { - - /** - * (Required) A unique generator name that can be referenced - * by one or more classes to be the generator for id values. - */ - String name(); - - /** - * (Optional) Name of table that stores the generated id values. - *

Defaults to a name chosen by persistence provider. - */ - String table() default ""; - - /** (Optional) The catalog of the table. - *

Defaults to the default catalog. - */ - String catalog() default ""; - - /** (Optional) The schema of the table. - *

Defaults to the default schema for user. - */ - String schema() default ""; - - /** - * (Optional) Name of the primary key column in the table. - *

Defaults to a provider-chosen name. - */ - String pkColumnName() default ""; - - /** - * (Optional) Name of the column that stores the last value generated. - *

Defaults to a provider-chosen name. - */ - String valueColumnName() default ""; - - /** - * (Optional) The primary key value in the generator table - * that distinguishes this set of generated values from others - * that may be stored in the table. - *

Defaults to a provider-chosen value to store in the - * primary key column of the generator table - */ - String pkColumnValue() default ""; - - /** - * (Optional) The initial value to be used when allocating id - * numbers from the generator. - */ - int initialValue() default 0; - - /** - * (Optional) The amount to increment by when allocating id - * numbers from the generator. - */ - int allocationSize() default 50; - - /** - * (Optional) Unique constraints that are to be placed on the - * table. These are only used if table generation is in effect. - * These constraints apply in addition to primary key constraints. - *

Defaults to no additional constraints. - */ - UniqueConstraint[] uniqueConstraints() default {}; -} diff --git a/utils/src/javax/persistence/Temporal.java b/utils/src/javax/persistence/Temporal.java deleted file mode 100644 index 8d0fdf33fbd..00000000000 --- a/utils/src/javax/persistence/Temporal.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static javax.persistence.TemporalType.TIMESTAMP; - -/** - * This annotation must be specified for persistent fields - * or properties of type {@link java.util.Date} and {@link - * java.util.Calendar}. It may only be specified for fields - * or properties of these types. - * - *

The Temporal annotation may be used in - * conjunction with the {@link Basic} annotation. - * - *

- *     Example:
- * 
- *     @Temporal(DATE)
- *     protected java.util.Date endDate;
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface Temporal { - - /** The type used in mapping java.util.Date or java.util.Calendar. */ - TemporalType value(); -} diff --git a/utils/src/javax/persistence/TemporalType.java b/utils/src/javax/persistence/TemporalType.java deleted file mode 100644 index 8ed20c981d5..00000000000 --- a/utils/src/javax/persistence/TemporalType.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -/** - * Type used to indicate a specific mapping of {@link java.util.Date} - * or {@link java.util.Calendar}. - * - * @since Java Persistence 1.0 - */ -public enum TemporalType { - - /** Map as java.sql.Date */ - DATE, - - /** Map as java.sql.Time */ - TIME, - - /** Map as java.sql.Timestamp */ - TIMESTAMP -} diff --git a/utils/src/javax/persistence/Transient.java b/utils/src/javax/persistence/Transient.java deleted file mode 100644 index b4be9746a3a..00000000000 --- a/utils/src/javax/persistence/Transient.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation specifies that the property or field is - * not persistent. It is used to annotate a property or field - * of an entity class, mapped superclass, or embeddable class. - * - *
- *    Example:
- *    @Entity
- *    public class Employee {
- *        @Id int id;
- *        @Transient User currentUser;
- *        ...
- *    }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface Transient {} diff --git a/utils/src/javax/persistence/UniqueConstraint.java b/utils/src/javax/persistence/UniqueConstraint.java deleted file mode 100644 index ab8ce10858a..00000000000 --- a/utils/src/javax/persistence/UniqueConstraint.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation is used to specify that a unique constraint - * is to be included in the generated DDL for a primary or secondary table. - * - *
- *    Example:
- *    @Entity
- *    @Table(
- *        name="EMPLOYEE", 
- *        uniqueConstraints=
- *            @UniqueConstraint(columnNames={"EMP_ID", "EMP_NAME"})
- *    )
- *    public class Employee { ... }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({}) -@Retention(RUNTIME) - -public @interface UniqueConstraint { - - /** (Required) An array of the column names that make up the constraint. */ - String[] columnNames(); -} diff --git a/utils/src/javax/persistence/Version.java b/utils/src/javax/persistence/Version.java deleted file mode 100644 index 53efdcea8d2..00000000000 --- a/utils/src/javax/persistence/Version.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can obtain - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. - * Sun designates this particular file as subject to the "Classpath" exception - * as provided by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the License - * Header, with the fields enclosed by brackets [] replaced by your own - * identifying information: "Portions Copyrighted [year] - * [name of copyright owner]" - * - * Contributor(s): - * - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package javax.persistence; - -import java.lang.annotation.Target; -import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * This annotation specifies the version field or property of - * an entity class that serves as its optimistic lock value. - * The version is used to ensure integrity when performing the - * merge operation and for optimistic concurrency control. - * - *

Only a single Version property or field - * should be used per class; applications that use more than one - * Version property or field will not be portable. - * - *

The Version property should be mapped to - * the primary table for the entity class; applications that - * map the Version property to a table other than - * the primary table will not be portable. - * - *

The following types are supported for version properties: - * int, {@link Integer}, short, - * {@link Short}, long, {@link Long}, - * {@link java.sql.Timestamp Timestamp}. - * - *

- *    Example:
- *
- *    @Version
- *    @Column(name="OPTLOCK")
- *    protected int getVersionNum() { return versionNum; }
- * 
- * - * @since Java Persistence 1.0 - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) - -public @interface Version {} diff --git a/utils/src/javax/persistence/package.html b/utils/src/javax/persistence/package.html deleted file mode 100644 index 120a5dcecd7..00000000000 --- a/utils/src/javax/persistence/package.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - -The javax.persistence package contains the classes and interfaces that -define the contracts between a persistence provider and the managed -classes and the clients of the Java Persistence API. - -