diff --git a/.gitignore b/.gitignore index 46bf0be5bea..8e3e87e550e 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,5 @@ deps/cloud.userlibraries .DS_Store .idea *.iml +git-remote-https.exe.stackdump *.swp diff --git a/KEYS b/KEYS index b0f868529e9..b399d9cb662 100644 --- a/KEYS +++ b/KEYS @@ -198,3 +198,91 @@ p7S7eSiSwAZT56oHx9ULzBAKYvwyyoIVOnc0ddwhLeGq2flP7xSo54oDw4KRlFuu rHMalutU5/Bc0tFZtdm6DnSnwtg3fBnwgFBeINJCc31xuX474+071mfaQUVO7g== =BzOC -----END PGP PUBLIC KEY BLOCK----- +pub 4096R/6FE50F1C 2012-05-11 [expires: 2017-05-10] +uid David Nalley (Code signing key) +sig 3 6FE50F1C 2012-05-11 David Nalley (Code signing key) +sig F2EFD0F0 2012-05-21 Christopher David Schultz (Christopher David Schultz) +sig A67F707E 2012-05-21 Christopher Schultz +sig 4C75EA05 2012-05-31 Kevin A. McGrail (CODE SIGNING KEY) +sig E70D2357 2012-08-09 David Nalley +sub 4096R/1E5F6D9D 2012-05-11 [expires: 2017-05-10] +sig 6FE50F1C 2012-05-11 David Nalley (Code signing key) + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.12 (GNU/Linux) + +mQINBE+tml4BEADjjxemcIdmFj4CuJYCpHBldoot3oF0Dqvez8ok7KnmNc/jrbgH +rZ6/DYq8SzebTbQSel4bCkLLnaI4Yu3C4Rd2uYPF6EHjs+kM4etKJLOiwfv5/EA9 +l0TYwNldkZaE7Y/B+XDrzQIxCWiWeH8O01EKJxZhjtcmeZYS3n1/gozQmDxNcbaW +QJJn6Vktqek6n30fPGsQl7tZyfnoSTvjDblze/dFSmyJaCeGDfljlwhXfNBFhJct +LxjmbiD21kRZvs9dWJZRFDQhw6g2HZIQ8MXAC6PUhoJgvqeBDUGUr6B7lb1IfTrl +CKBQLKAURZXKmLlRzh3IMTEyKpmV2D80erRf39S3CiRNEYlnn1fHovmnkiV9QLvG +rgjwDcvuw3Y2lBNaQRuSLm55sBmPBVDSU3aABbZfupOntlnV/oIyl32fiF7MAHT9 +8mV4c58urjbJKkq9R/0U/pZxqWOQfnnt/t66hdOe1p5O29c7nW5V0rlNDFAm2GXL +OKhvS/crBfz4gpI7U7KAq5aMA1F0ZgGJwGVs7Lv6uvl9O/4M7/3g5b390yuRzJzw +ZXF41wJC8Zwlw+KJcrcTkzbUjpGoNoblfAOV/YV3WNnJGOs3hL12vktsgADcjl2R +T6x7QAayZQyfaSD1UwXSHBHi7Lh6ABj6zQnlcan/8/j0mEVMe+q/5CkGPQARAQAB +tDNEYXZpZCBOYWxsZXkgKENvZGUgc2lnbmluZyBrZXkpIDxrZTRxcXFAYXBhY2hl +Lm9yZz6JAj4EEwECACgFAk+tml4CGwMFCQlmAYAGCwkIBwMCBhUIAgkKCwQWAgMB +Ah4BAheAAAoJEExw8Ghv5Q8c2kEP/RhSY6cuypHNTFsVWYm6eaxHR5z1duPvwAhf +7LG4QoqaEJwGJSlrDScQA/sAJZli0eswsIDho8e9iywrREWCrsUKnNcZNaw1y36q +vCTwuAvtfW1H6/fNFwErzYHSIOUxYwRoylxVhYSW5renheeHmxsLtKqLavo+MDV+ +Shr/CGcnVypbW8MrcL0q6OWb+eCJUsB0JIotXRitTGrCV6ulyOWSnq0CXT3EkrT4 +rkXf9dINoAKzqoF5UE+9oGFJxQFFEY3ppgh9p1qaDHTzoKwrVxp+ssBNm7N1CAff +JIb4b2MoWeNuK6lZPR24dGhsxBIZPn9Nlxzczuvbb+lUDvvA8gedYcSTOe5x/7k8 +J3Niu7S50HP7Y2II2RS5zqTMbJJRVu7nZKQYXjM8pItuTiZqaEwl1QyIfuSfXTbf +i35IWO+ZHpMYqUGeAlugIquFRmF50YBMnqm104Gft1DUm92eb5si3gXRNxrH2t0Z ++yHb1iD2873WrhMatgSmpcRYZyWsYTUEUhGT2P2+oo3c7YjfqyJ1rx6ilIhvRLao +ooJ83iobbaDGy0C+jQMvIh9jgJ8Ca9Fy6m3jPjxDke9DlSh4P4o0yct8JGHF334Y +6AMk84+FvFh5AiZHqnP/sXdp8NW59sNJPUWSunjrQ1iRSJv0goMso6sjks6w1Hfs +JxpmWXjJiEYEEBEIAAYFAk+6TxgACgkQ9CaO5/Lv0PAGTQCgjR9jnKgClMp5lhY+ +vmeOWrAmTlEAn3aJ/RWKj9OfO98ERRJ/HGcKL010iQIcBBABCAAGBQJPuk86AAoJ +EPOtXJSmf3B+p3MP+wSU/CeCdXuvKTEBj6JtB+GAi7zSFNrBkuu5s7wCnEhr1BQ8 +u6LcP9beLFZstMbouyz6EZU0CdSkxURXZtsVJrDR1hJYuZ8uPSA+gldCmvoU6ECj +xIUIsq2W2fTG5UTSwQ3JXa+mZS+bRByFeCBCSrMxgqlRooRJ9PDOfJyZ6N/RUTpZ +SzhhgSKFs/Uv8xu/as4b2Ec32jpOmZcF5RiKMkp3zYenW01l/E1KM1PRfKTZRv4j +tTqqJELVqoBRM1Z/H/in7VIdSBDoI4K3W9BbDyvaUh5GgzLgwRkc94PTJ2mMEgA/ +EBsKi2VDWU4AZ/CLjlqunqqLfEzdekHF9HC4iZsqjuodWOYzc/ECLE07w1/WAxOG +wR0Kevyf+GdQ6Nq4DfhwGRzNwhsGJBoqLu785kUZ9w9wbv6aGq9/AYtGVAt7g3IA +S/5H6QQZLic3MswAZHDg1dtBgO6Q32UTl0AcZ7qRBRfnhrhqC71rhMAhlGdzld82 +MzFPQbCqAM8dUqIY67Hoyn0c0P+kw73QGcG/MDyIvYrBuu7fmCEq8V4fHaY38awJ +ydlIyhZhrrpW+o10BlbEuoBgDgFkDeynK0lUbusqrhCE/oAUHXfqXfzZ0Chx5EKK +jAcM1Q2/t3WnIPkXn3CAJRTnz7WJ0dN/OETJEvlDAhulUVzRbGCPXJBaxBKMiQIc +BBABAgAGBQJPx/i4AAoJECFN/YxMdeoFCywP/3AmFE+8tDj0VGrosKO7oRXCP6Dk +krfhezVQjDHAuvTMCJpYc71uvBOLOf6jSrSWcmJJXz89LBWRjLl5QpuHpYOLgn7j +90NXmW5tJY3lladQovMhmbnJehgK6POj8glq8jn8fAeKMM3npHxNcvoQ2ivXB0IL +1B0foM/RdyBgFjjFiISZwkDQRXcfaK9lQgQlIWu5Wts+YCMTR5aBrvVYchZAdKaB +q/gtmFjeCGy/d8Pch/hgevQLngap3X4pkldpHy1NtRNg/MqzTP7FjiinNJYUBga8 +rTSeBLhk+X8bfL6FttiruVNTr8oX5RBNJlceV4l06vvvczJtTH/ROj8Vr/Lw4xTB +RKCWmAEzEYwITjpVDK/4U6NeZbIp1Srbi8IHPKHq9IYWiSZLP/fbtBSK418AiECw +A88CS3MA64f3X5i8AkDHV9fMccftTSzt4ovkTm3wrbDiqjfNzi6tfl9wt1Mc1fYh +krIO+OMZoQrI3+7kw52HHoXWs2w28CGYlH16foo/PdylSVTf09MV1uLmYOS/6A8l +1AYAxI6DDORz9qMIvj+jlHeJKDsUrIs2n2OEWnbe1jCJFsVlEHUWLqqBbfdIne8P +T9NX+mJzWhrxfm8XVHQpK8KxITej8Uuigj8W3Od1J/OJ3FfQ2Xzm8pOn0764cSKB +Deu05Hw2S4WgZ82DiEYEEBECAAYFAlAjB7oACgkQkZOYj+cNI1eTIgCfSPvYLhnh +CQXpYDeWn5QsUKO44eEAni3xVhrnCOrpBGWHu5QUX9cJx0yduQINBE+tml4BEADV +omhZSUujC2B/e6ghmTM7p9W4xVkP/OQVWzrNe7JaCkw1KOHeU5pWyQsxYV20jA6g +LZLIDbH3Wf2wWpyOMrvRR8T2ChxLe3IuFY3qMTGeldU5cYDrBRgQ8XDeVGp5qHee +2cbqWTxmSCgf+ux8vdAfw+d1LtyFQT08E7Q3fLLlZ5t1MxfwCl58SqwjyF7IwMvh +vLqDkqS0lcAj7uK8CspUQur7xnfZhB77mjAayPZyZxkZXcJ6ujJzwH1VRoslzQw0 +RjSEOCewQ082PdEcZ/TxRMKKbheKsIRlMmJlP5bQd+bICivGR6JDOyRXNhx8BPhX +jeSiaYjdgLx+LqVzRFkMhQzzD4TdB6EuBgAUo+Qz8hMvXqw64NH2kXA9OsEq2yQn ++RLRTX3Eo9KwNMIwlmqRip+l6MUH+7zHILFohkBDgFAKyL6ExMbNOKts/kmsVQlk +5pznm3+ofZ1zDGeF5072JMLPJQn0cyg3UfGR+raSnn1+Zal6yGwqgZkfm5aGvEzG +jC2hj+Jfl1oGy5cnCk5Jia1wboG3wkxwNRN8sNLjSmv7sdJ87LyHYollvNGUayzt +PwdAlDHQqPEurzO0uy2WSjdEc6ZdBNYNJzDBJhHIy4kET1TxPWpfaHt35slT6tTK +7hvQ7VC1VwwSnqlDcw5VJTjIb9ue5KM5c4XhUgPXsQARAQABiQIlBBgBAgAPBQJP +rZpeAhsMBQkJZgGAAAoJEExw8Ghv5Q8cIAMP/jzbOVGNz/Uuzf/GKCQ4CudS5Ada +RjNHI4ATAcdGqXCKMzPGVVFDdxJF6yGPyq3wQD0FIwmpJGppjNuHk5eJ8UafqAHe +oynr7izB80o2CdYVMoMVa9Um0lALdCigAJQbu6sjQm5mN3qDVBpEcRzffchb/de8 +GcbH2I/iEZ7L+Og73bw3yFXKwGS/vZ/8ZLEh20cqHzwB/4JjnnCLASgpPsaCGrXF +y0NW+Yo0HrN5deEMexYADDGPE2MQAWC5QjEvxm24yiO2q//xAtUUNVrKDXXbnwaN +BvlNzqNc1iCKcXghV8euwNyTF++UwDCT1x5bcAntl3wYHSHKasae3omvmja+Wdfs +iFZHQtzZXgFjPm0C1Y5v1uG+YmzLa0gDX3Lol0n+ANzZNKFSw/zXacyl9wavnUjh +ITiT9WbmXiEc575jUIlkqxP0Sqg8Afpk/tB5PGyan8GbsTVX7EE/l6724ZLyvH4/ +Zuvhhqa4HA6hYwiNuXxoUBmabiMULIBZYdsn9znjRKeh6oeoqRa2C2El46o05sy+ +woXtbjtbPIeSV1o7KUax0tkg2VqeKBW/qXBkyzLbRSC+vsYVpnO5pPqjaBPoqgIw +vWtDEroKvHDVC+T76U+BlKTooOU0sdWGS8x25HbFVUaxOOFEybkZiFZ2cOlADgcj +R5fTvoVeebaUFoTe +=d4EI +-----END PGP PUBLIC KEY BLOCK----- diff --git a/LICENSE b/LICENSE index bf90869e0a5..739063639c2 100644 --- a/LICENSE +++ b/LICENSE @@ -205,3 +205,289 @@ Third party licenses ==================== +==================================== CDDL v1 ==================================== + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + + + +1. Definitions. + + + +1.1. Contributor means each individual or entity that creates or contributes to the creation of Modifications. + + + +1.2. Contributor Version means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. + + + +1.3. Covered Software means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. + + + +1.4. Executable means the Covered Software in any form other than Source Code. + + + +1.5. Initial Developer means the individual or entity that first makes Original Software available under this License. + + + +1.6. Larger Work means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. + + + +1.7. License means this document. + + + +1.8. Licensable means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. + + + +1.9. Modifications means the Source Code and Executable form of any of the following: + + + +A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; + + + +B. Any new file that contains any part of the Original Software or previous Modification; or + + + +C. Any new file that is contributed or otherwise made available under the terms of this License. + + + +1.10. Original Software means the Source Code and Executable form of computer software code that is originally released under this License. + + + +1.11. Patent Claims means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. + + + +1.12. Source Code means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. + + + +1.13. You (or Your) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, You includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, control means (a)áthe power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b)áownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + + + +2. License Grants. + + + +2.1. The Initial Developer Grant. + +Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). + +(c) The licenses granted in Sectionsá2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. + +(d) Notwithstanding Sectioná2.1(b) above, no patent license is granted: (1)áfor code that You delete from the Original Software, or (2)áfor infringements caused by: (i)áthe modification of the Original Software, or (ii)áthe combination of the Original Software with other software or devices. + + + +2.2. Contributor Grant. + +Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1)áModifications made by that Contributor (or portions thereof); and (2)áthe combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). + +(c) The licenses granted in Sectionsá2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. + +(d) Notwithstanding Sectioná2.2(b) above, no patent license is granted: (1)áfor any code that Contributor has deleted from the Contributor Version; (2)áfor infringements caused by: (i)áthird party modifications of Contributor Version, or (ii)áthe combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3)áunder Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. + + + +3. Distribution Obligations. + + + +3.1. Availability of Source Code. + + + +Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. + + + +3.2. Modifications. + + + +The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. + + + +3.3. Required Notices. + +You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. + + + +3.4. Application of Additional Terms. + +You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. + + + +3.5. Distribution of Executable Versions. + +You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipients rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. + + + +3.6. Larger Works. + +You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. + + + +4. Versions of the License. + + + +4.1. New Versions. + +Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. + + + +4.2. Effect of New Versions. + + + +You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. + +4.3. Modified Versions. + + + +When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a)árename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b)áotherwise make it clear that the license contains terms which differ from this License. + + + +5. DISCLAIMER OF WARRANTY. + + + +COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + + + +6. TERMINATION. + + + +6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. + + + +6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as Participant) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sectionsá2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. + + + +6.3. In the event of termination under Sectionsá6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. + + + +7. LIMITATION OF LIABILITY. + + + +UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTYS NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + + + +8. U.S. GOVERNMENT END USERS. + + + +The Covered Software is a commercial item, as that term is defined in 48áC.F.R.á2.101 (Oct. 1995), consisting of commercial computer software (as that term is defined at 48 C.F.R. á252.227-7014(a)(1)) and commercial computer software documentation as such terms are used in 48áC.F.R.á12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. + + + +9. MISCELLANEOUS. + + + +This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdictions conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. + + + +10. RESPONSIBILITY FOR CLAIMS. + + + +As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. + + + +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) + +The GlassFish code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. + + +================================ End of CDDL v1 ================================= + +============================== BSD License for WAF ============================== + +Copyrighted by Thomas Nagy, 2005-2010 + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +========================== End of BSD License for WAF =========================== + +============================= MIT License for SLF4J ============================= +Copyright (c) 2004-2008 QOS.ch +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +========================= End of MIT License for SLF4J ========================== + + diff --git a/LICENSE_BIN b/LICENSE_BIN new file mode 100644 index 00000000000..fa0c3e1bd10 --- /dev/null +++ b/LICENSE_BIN @@ -0,0 +1,498 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +============================ End of Apache License file V 2.0 =================== + +Third party licenses +==================== + +==================================== CDDL v1 ==================================== + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + + + +1. Definitions. + + + +1.1. Contributor means each individual or entity that creates or contributes to the creation of Modifications. + + + +1.2. Contributor Version means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. + + + +1.3. Covered Software means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. + + + +1.4. Executable means the Covered Software in any form other than Source Code. + + + +1.5. Initial Developer means the individual or entity that first makes Original Software available under this License. + + + +1.6. Larger Work means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. + + + +1.7. License means this document. + + + +1.8. Licensable means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. + + + +1.9. Modifications means the Source Code and Executable form of any of the following: + + + +A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; + + + +B. Any new file that contains any part of the Original Software or previous Modification; or + + + +C. Any new file that is contributed or otherwise made available under the terms of this License. + + + +1.10. Original Software means the Source Code and Executable form of computer software code that is originally released under this License. + + + +1.11. Patent Claims means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. + + + +1.12. Source Code means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. + + + +1.13. You (or Your) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, You includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, control means (a)áthe power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b)áownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + + + +2. License Grants. + + + +2.1. The Initial Developer Grant. + +Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). + +(c) The licenses granted in Sectionsá2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. + +(d) Notwithstanding Sectioná2.1(b) above, no patent license is granted: (1)áfor code that You delete from the Original Software, or (2)áfor infringements caused by: (i)áthe modification of the Original Software, or (ii)áthe combination of the Original Software with other software or devices. + + + +2.2. Contributor Grant. + +Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1)áModifications made by that Contributor (or portions thereof); and (2)áthe combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). + +(c) The licenses granted in Sectionsá2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. + +(d) Notwithstanding Sectioná2.2(b) above, no patent license is granted: (1)áfor any code that Contributor has deleted from the Contributor Version; (2)áfor infringements caused by: (i)áthird party modifications of Contributor Version, or (ii)áthe combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3)áunder Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. + + + +3. Distribution Obligations. + + + +3.1. Availability of Source Code. + + + +Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. + + + +3.2. Modifications. + + + +The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. + + + +3.3. Required Notices. + +You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. + + + +3.4. Application of Additional Terms. + +You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. + + + +3.5. Distribution of Executable Versions. + +You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipients rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. + + + +3.6. Larger Works. + +You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. + + + +4. Versions of the License. + + + +4.1. New Versions. + +Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. + + + +4.2. Effect of New Versions. + + + +You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. + +4.3. Modified Versions. + + + +When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a)árename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b)áotherwise make it clear that the license contains terms which differ from this License. + + + +5. DISCLAIMER OF WARRANTY. + + + +COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + + + +6. TERMINATION. + + + +6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. + + + +6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as Participant) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sectionsá2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. + + + +6.3. In the event of termination under Sectionsá6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. + + + +7. LIMITATION OF LIABILITY. + + + +UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTYS NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + + + +8. U.S. GOVERNMENT END USERS. + + + +The Covered Software is a commercial item, as that term is defined in 48áC.F.R.á2.101 (Oct. 1995), consisting of commercial computer software (as that term is defined at 48 C.F.R. á252.227-7014(a)(1)) and commercial computer software documentation as such terms are used in 48áC.F.R.á12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. + + + +9. MISCELLANEOUS. + + + +This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdictions conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. + + + +10. RESPONSIBILITY FOR CLAIMS. + + + +As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. + + + +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) + +The GlassFish code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. + + +================================ End of CDDL v1 ================================= + +============================= BSD License for JUnit ============================= + +BSD License + +Copyright (c) 2000-2006, www.hamcrest.org +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of +conditions and the following disclaimer. Redistributions in binary form must reproduce +the above copyright notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the distribution. + +Neither the name of Hamcrest nor the names of its contributors may be used to endorse +or promote products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +========================= End of BSD License for JUnit ========================== + +============================= MIT License for SLF4J ============================= +Copyright (c) 2004-2008 QOS.ch +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +========================= End of MIT License for SLF4J ========================== diff --git a/NOTICE b/NOTICE index 8a3b0bf2494..51b034f47be 100644 --- a/NOTICE +++ b/NOTICE @@ -4,5 +4,10 @@ Copyright 2012 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). -This product includes JUnit (http://www.junit.org/) -under the Common Public License Version 1.0: http://www.opensource.org/licenses/cpl.php +This product includes WAF (http://code.google.com/p/waf/) +under the BSD License: http://opensource.org/licenses/BSD-3-Clause +Thomas Nagy, 2005-2010 + +This product includes Simple Logging Facade for Java or (SLF4J) (http://www.slf4j.org/) +under the MIT license: http://www.slf4j.org/license.html +Copyright (c) 2004-2011 QOS.ch diff --git a/NOTICE_BIN b/NOTICE_BIN new file mode 100644 index 00000000000..cf1a9d1adeb --- /dev/null +++ b/NOTICE_BIN @@ -0,0 +1,19 @@ +Apache CloudStack +Copyright 2012 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +This product includes JavaMail(TM) API Reference Implementation +(http://www.oracle.com/technetwork/java/javamail/index.html), +obtained from http://repo1.maven.org/maven2/javax/mail/mail/1.4/mail-1.4.jar +under the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + +This product includes JUnit (http://www.junit.org/) +under the BSD License: http://opensource.org/licenses/BSD-3-Clause +Copyright (c) 2000-2006, www.hamcrest.org + +This product includes Simple Logging Facade for Java or (SLF4J) (http://www.slf4j.org/) +under the MIT license: http://www.slf4j.org/license.html +Copyright (c) 2004-2011 QOS.ch + diff --git a/agent/bindir/cloud-setup-agent.in b/agent/bindir/cloud-setup-agent.in index ebb2340637a..5e2ba09406d 100755 --- a/agent/bindir/cloud-setup-agent.in +++ b/agent/bindir/cloud-setup-agent.in @@ -28,34 +28,34 @@ from cloudutils.networkConfig import networkConfig from cloudutils.syscfg import sysConfigFactory from optparse import OptionParser - -def getUserInputs(): - print "Welcome to Cloud Agent Setup:" - cfo = configFileOps("/etc/cloud/agent/agent.properties") +def getUserInputs(): + print "Welcome to the CloudStack Agent Setup:" + + cfo = configFileOps("@AGENTSYSCONFDIR@/agent.properties") oldMgt = cfo.getEntry("host") - mgtSvr = raw_input("Please input the Management Server Name/IP:[%s]"%oldMgt) + mgtSvr = raw_input("Please input the Management Server Hostname/IP-Address:[%s]"%oldMgt) if mgtSvr == "": mgtSvr = oldMgt try: socket.getaddrinfo(mgtSvr, 443) except: - print "Failed to resolve %s. Please input correct server name or IP."%mgtSvr + print "Failed to resolve %s. Please input a valid hostname or IP-Address."%mgtSvr exit(1) oldToken = cfo.getEntry("zone") zoneToken = raw_input("Please input the Zone Id:[%s]"%oldToken) - + if zoneToken == "": zoneToken = oldToken oldPod = cfo.getEntry("pod") podId = raw_input("Please input the Pod Id:[%s]"%oldPod) - + if podId == "": podId = oldToken - + oldCluster = cfo.getEntry("cluster") clusterId = raw_input("Please input the Cluster Id:[%s]"%oldCluster) if clusterId == "": @@ -66,7 +66,7 @@ def getUserInputs(): except: print "Failed to get default route. Please configure your network to have a default route" exit(1) - + defNic = defaultNic.name network = raw_input("Please choose which network used to create VM:[%s]"%defNic) if network == "": @@ -79,21 +79,21 @@ def getUserInputs(): return [mgtSvr, zoneToken, network, podId, clusterId] if __name__ == '__main__': - initLoging("/var/log/cloud/setupAgent.log") + initLoging("@AGENTLOGDIR@/setup.log") glbEnv = globalEnv() glbEnv.mode = "Agent" glbEnv.agentMode = "Agent" parser = OptionParser() parser.add_option("-a", action="store_true", dest="auto", help="auto mode") - parser.add_option("-m", "--host", dest="mgt", help="management server name or IP") + parser.add_option("-m", "--host", dest="mgt", help="Management server hostname or IP-Address") parser.add_option("-z", "--zone", dest="zone", help="zone id") parser.add_option("-p", "--pod", dest="pod", help="pod id") parser.add_option("-c", "--cluster", dest="cluster", help="cluster id") parser.add_option("-g", "--guid", dest="guid", help="guid") - parser.add_option("--pubNic", dest="pubNic", help="public nic") - parser.add_option("--prvNic", dest="prvNic", help="private nic") - parser.add_option("--guestNic", dest="guestNic", help="guest nic") + parser.add_option("--pubNic", dest="pubNic", help="Public traffic interface") + parser.add_option("--prvNic", dest="prvNic", help="Private traffic interface") + parser.add_option("--guestNic", dest="guestNic", help="Guest traffic interface") (options, args) = parser.parse_args() if options.auto is None: @@ -104,7 +104,7 @@ if __name__ == '__main__': glbEnv.pod = userInputs[3] glbEnv.cluster = userInputs[4] #generate UUID - glbEnv.uuid = configFileOps("/etc/cloud/agent/agent.properties").getEntry("guid") + glbEnv.uuid = configFileOps("@AGENTSYSCONFDIR@/agent.properties").getEntry("guid") if glbEnv.uuid == "": glbEnv.uuid = bash("uuidgen").getStdout() else: @@ -127,7 +127,7 @@ if __name__ == '__main__': syscfg = sysConfigFactory.getSysConfigFactory(glbEnv) try: syscfg.config() - print "Cloud Agent setup is Done!" + print "CloudStack Agent setup is done!" except (CloudRuntimeException,CloudInternalException), e: print e print "Try to restore your system:" diff --git a/agent/conf/agent.properties b/agent/conf/agent.properties index 5e3c8db0660..27572b53653 100644 --- a/agent/conf/agent.properties +++ b/agent/conf/agent.properties @@ -17,6 +17,10 @@ # Sample configuration file for CloudStack agent +# The GUID to identify the agent with, this is mandatory! +# Generate with "uuidgen" +guid= + #resource= the java class, which agent load to execute resource=com.cloud.hypervisor.kvm.resource.LibvirtComputingResource @@ -29,24 +33,39 @@ host=localhost #port = The port management server listening on, default is 8250 port=8250 -#pod= The pod, which agent belonged to +#cluster= The cluster which the agent belongs to +cluster=default + +#pod= The pod which the agent belongs to pod=default -#zone= The zone, which agent belonged to +#zone= The zone which the agent belongs to zone=default -#private.network.device= the private nic device -# if this is commented, it is autodetected on service startup -# private.network.device=cloudbr0 - #public.network.device= the public nic device # if this is commented, it is autodetected on service startup # public.network.device=cloudbr0 -#guid= a GUID to identify the agent +#private.network.device= the private nic device +# if this is commented, it is autodetected on service startup +# private.network.device=cloudbr1 -#vm.migrate.speed set the vm migrate speed, by default, it's the speed of guest network -#local.storage.path local storage path, by default, it's /var/lib/libvirt/images/ -#cmds.timeout the timeout for time-consuming operations, such create/copy snapshot +#guest.network.device= the guest nic device +# if this is commented, the private nic device will be used +# local storage path, by default, it's /var/lib/libvirt/images/ +#local.storage.path=/var/lib/libvirt/images/ +# The UUID for the local storage pool, this is mandatory! +# Generate with "uuidgen" +local.storage.uuid= + +# Location for KVM scripts +domr.scripts.dir=scripts/network/domr/kvm + +# the timeout for time-consuming operations, such as create/copy snapshot +#cmds.timeout=7200 + +# set the vm migrate speed, by default, it will try to guess the speed of the guest network +# In MegaBytes per second +#vm.migrate.speed=0 diff --git a/agent/conf/dummy.agent.properties b/agent/conf/dummy.agent.properties deleted file mode 100644 index 5f8fefa8716..00000000000 --- a/agent/conf/dummy.agent.properties +++ /dev/null @@ -1,34 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -resource=com.cloud.agent.resource.DummyResource -host.mac.address=06\:95\:a4\:00\:03\:ee -guest.network.device=cloudbr0 -type=Routing -local.storage.uuid=8c348eee-ea56-4e4f-9397-00f33340927a -port=8250 -host=10.216.132.110 -pod=1 -LibvirtComputingResource.id=1 -cluster=1 -public.network.device=cloudbr0 -private.network.device=cloudbr0 -DummyResource.id=11 -developer=True -zone=1 -domr.scripts.dir=scripts/network/domr/kvm -workers=5 diff --git a/agent/src/com/cloud/agent/AgentShell.java b/agent/src/com/cloud/agent/AgentShell.java index ca3f7de02f4..05caf8e6cda 100644 --- a/agent/src/com/cloud/agent/AgentShell.java +++ b/agent/src/com/cloud/agent/AgentShell.java @@ -292,7 +292,7 @@ public class AgentShell implements IAgentShell { if (tokens[0].equalsIgnoreCase("port")) { port = tokens[1]; - } else if (tokens[0].equalsIgnoreCase("threads")) { + } else if (tokens[0].equalsIgnoreCase("threads") || tokens[0].equalsIgnoreCase("workers")) { workers = tokens[1]; } else if (tokens[0].equalsIgnoreCase("host")) { host = tokens[1]; diff --git a/api/src/com/cloud/user/UserContext.java b/api/src/com/cloud/user/UserContext.java index ed33e88d027..b140728e596 100644 --- a/api/src/com/cloud/user/UserContext.java +++ b/api/src/com/cloud/user/UserContext.java @@ -16,11 +16,14 @@ // under the License. package com.cloud.user; +import com.cloud.server.ManagementService; +import com.cloud.utils.component.ComponentLocator; public class UserContext { private static ThreadLocal s_currentContext = new ThreadLocal(); - private static UserContext s_adminContext = null; + private static final ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name); + private static final AccountService _accountMgr = locator.getManager(AccountService.class); private long userId; private String sessionId; @@ -30,7 +33,9 @@ public class UserContext { private String eventDetails; private boolean apiServer; - + + private static UserContext s_adminContext = new UserContext(_accountMgr.getSystemUser().getId(), _accountMgr.getSystemAccount(), null, false); + public UserContext() { } @@ -129,10 +134,4 @@ public class UserContext { public String getEventDetails() { return eventDetails; } - - public static synchronized void setAdminContext(UserContext adminContext) { - if (adminContext == null) { - UserContext.s_adminContext = adminContext; - } - } } diff --git a/cloud.spec b/cloud.spec index 28401a661f6..47a457a0c38 100644 --- a/cloud.spec +++ b/cloud.spec @@ -556,7 +556,6 @@ fi %files agent %defattr(0644,root,root,0755) %config(noreplace) %{_sysconfdir}/%{name}/agent/agent.properties -%config(noreplace) %{_sysconfdir}/%{name}/agent/dummy.agent.properties %config(noreplace) %{_sysconfdir}/%{name}/agent/developer.properties.template %config(noreplace) %{_sysconfdir}/%{name}/agent/environment.properties %config(noreplace) %{_sysconfdir}/%{name}/agent/log4j-%{name}.xml 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..d322a79d304 100644 --- a/core/src/com/cloud/network/security/SecurityGroupRulesVO.java +++ b/core/src/com/cloud/network/security/SecurityGroupRulesVO.java @@ -24,11 +24,14 @@ import javax.persistence.Id; import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.SecondaryTable; import javax.persistence.Table; + import com.cloud.network.security.SecurityRule.SecurityRuleType; +import com.cloud.utils.db.JoinType; @Entity @Table(name = ("security_group")) -@SecondaryTable(name = "security_group_rule", join = "left", pkJoinColumns = { @PrimaryKeyJoinColumn(name = "id", referencedColumnName = "security_group_id") }) +@JoinType(type = "left") +@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 +61,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 +133,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 22c29a71115..8cb5816724d 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; @@ -55,7 +56,8 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject getDetails() { return details; } diff --git a/deps/cloud-ejb-api-3.0.jar b/deps/cloud-ejb-api-3.0.jar new file mode 100644 index 00000000000..e9a86d1ae57 Binary files /dev/null and b/deps/cloud-ejb-api-3.0.jar differ diff --git a/deps/cloud-javax.persistence-2.0.0.jar b/deps/cloud-javax.persistence-2.0.0.jar new file mode 100644 index 00000000000..62ee5c35beb Binary files /dev/null and b/deps/cloud-javax.persistence-2.0.0.jar differ diff --git a/docs/en-US/about-physical-networks.xml b/docs/en-US/about-physical-networks.xml new file mode 100644 index 00000000000..3d18b89a9ad --- /dev/null +++ b/docs/en-US/about-physical-networks.xml @@ -0,0 +1,24 @@ + + +%BOOK_ENTITIES; +]> +
+ About Physical Networks + Part of adding a zone is setting up the physical network. One or (in an advanced zone) more physical networks can be associated with each zone. The network corresponds to a NIC on the hypervisor host. Each physical network can carry one or more types of network traffic. The choices of traffic type for each network vary depending on whether you are creating a zone with basic networking or advanced networking. + A physical network is the actual network hardware and wiring in a zone. A zone can have multiple physical networks. An administrator can: + + Add/Remove/Update physical networks in a zone + Configure VLANs on the physical network + Configure a name so the network can be recognized by hypervisors + Configure the service providers (firewalls, load balancers, etc.) available on a physical network + Configure the IP addresses trunked to a physical network + Specify what type of traffic is carried on the physical network, as well as other properties like network speed + + + + + + + +
diff --git a/docs/en-US/about-pods.xml b/docs/en-US/about-pods.xml index 2183ed6a505..711db6b1ab5 100644 --- a/docs/en-US/about-pods.xml +++ b/docs/en-US/about-pods.xml @@ -24,5 +24,14 @@
About Pods - TODO + A pod often represents a single rack. Hosts in the same pod are in the same subnet. + A pod is the second-largest organizational unit within a &PRODUCT; deployment. Pods are contained within zones. Each zone can contain one or more pods. + Pods are not visible to the end user. + A pod consists of one or more clusters of hosts and one or more primary storage servers. + + + + + pod-overview.png: Nested structure of a simple pod +
diff --git a/docs/en-US/about-zones.xml b/docs/en-US/about-zones.xml new file mode 100644 index 00000000000..97d1b34fecf --- /dev/null +++ b/docs/en-US/about-zones.xml @@ -0,0 +1,32 @@ + + +%BOOK_ENTITIES; +]> +
+ About Zones + A zone is the largest organizational unit within a &PRODUCT; deployment. A zone typically corresponds to a single datacenter, although it is permissible to have multiple zones in a datacenter. The benefit of organizing infrastructure into zones is to provide physical isolation and redundancy. For example, each zone can have its own power supply and network uplink, and the zones can be widely separated geographically (though this is not required). + A zone consists of: + + One or more pods. Each pod contains one or more clusters of hosts and one or more primary storage servers. + Secondary storage, which is shared by all the pods in the zone. + + + + + + pod-overview.png: Nested structure of a simple pod + + Zones are visible to the end user. When a user starts a guest VM, the user must select a zone for their guest. Users might also be required to copy their private templates to additional zones to enable creation of guest VMs using their templates in those zones. + Zones can be public or private. Public zones are visible to all users. This means that any user may create a guest in that zone. Private zones are reserved for a specific domain. Only users in that domain or its subdomains may create guests in that zone. + Hosts in the same zone are directly accessible to each other without having to go through a firewall. Hosts in different zones can access each other through statically configured VPN tunnels. + For each zone, the administrator must decide the following. + + How many pods to place in a zone. + How many clusters to place in each pod. + How many hosts to place in each cluster. + How many primary storage servers to place in each cluster and total capacity for the storage servers. + How much secondary storage to deploy in a zone. + + When you add a new zone, you will be prompted to configure the zone’s physical network and add the first pod, cluster, host, primary storage, and secondary storage. +
diff --git a/docs/en-US/advanced-zone-guest-ip-addresses.xml b/docs/en-US/advanced-zone-guest-ip-addresses.xml new file mode 100644 index 00000000000..4b15183c430 --- /dev/null +++ b/docs/en-US/advanced-zone-guest-ip-addresses.xml @@ -0,0 +1,9 @@ + + +%BOOK_ENTITIES; +]> +
+ Advanced Zone Guest IP Addresses + When advanced networking is used, the administrator can create additional networks for use by the guests. These networks can span the zone and be available to all accounts, or they can be scoped to a single account, in which case only the named account may create guests that attach to these networks. The networks are defined by a VLAN ID, IP range, and gateway. The administrator may provision thousands of these networks if desired. +
\ No newline at end of file diff --git a/docs/en-US/advanced-zone-network-traffic-types.xml b/docs/en-US/advanced-zone-network-traffic-types.xml new file mode 100644 index 00000000000..adf2d9fb621 --- /dev/null +++ b/docs/en-US/advanced-zone-network-traffic-types.xml @@ -0,0 +1,16 @@ + + +%BOOK_ENTITIES; +]> +
+ Advanced Zone Network Traffic Types + When advanced networking is used, there can be multiple physical networks in the zone. Each physical network can carry one or more traffic types, and you need to let &PRODUCT; know which type of network traffic you want each network to carry. The traffic types in an advanced zone are: + + Guest. When end users run VMs, they generate guest traffic. The guest VMs communicate with each other over a network that can be referred to as the guest network. This network can be isolated or shared. In an isolated guest network, the administrator needs to reserve VLAN ranges to provide isolation for each &PRODUCT; account’s network (potentially a large number of VLANs). In a shared guest network, all guest VMs share a single network. + Management. When &PRODUCT;’s internal resources communicate with each other, they generate management traffic. This includes communication between hosts, system VMs (VMs used by &PRODUCT; to perform various tasks in the cloud), and any other component that communicates directly with the &PRODUCT; Management Server. You must configure the IP range for the system VMs to use. + Public. Public traffic is generated when VMs in the cloud access the Internet. Publicly accessible IPs must be allocated for this purpose. End users can use the &PRODUCT; UI to acquire these IPs to implement NAT between their guest network and the public network, as described in “Acquiring a New IP Address†in the Administration Guide. + Storage. Traffic such as VM templates and snapshots, which is sent between the secondary storage VM and secondary storage servers. &PRODUCT; uses a separate Network Interface Controller (NIC) named storage NIC for storage network traffic. Use of a storage NIC that always operates on a high bandwidth network allows fast template and snapshot copying. You must configure the IP range to use for the storage network. + + These traffic types can each be on a separate physical network, or they can be combined with certain restrictions. When you use the Add Zone wizard in the UI to create a new zone, you are guided into making only valid choices. +
\ No newline at end of file diff --git a/docs/en-US/advanced-zone-public-ip-addresses.xml b/docs/en-US/advanced-zone-public-ip-addresses.xml new file mode 100644 index 00000000000..2a38696af08 --- /dev/null +++ b/docs/en-US/advanced-zone-public-ip-addresses.xml @@ -0,0 +1,9 @@ + + +%BOOK_ENTITIES; +]> +
+ Advanced Zone Public IP Addresses + When advanced networking is used, the administrator can create additional networks for use by the guests. These networks can span the zone and be available to all accounts, or they can be scoped to a single account, in which case only the named account may create guests that attach to these networks. The networks are defined by a VLAN ID, IP range, and gateway. The administrator may provision thousands of these networks if desired. +
\ No newline at end of file diff --git a/docs/en-US/basic-zone-guest-ip-addresses.xml b/docs/en-US/basic-zone-guest-ip-addresses.xml new file mode 100644 index 00000000000..a29fffb7a50 --- /dev/null +++ b/docs/en-US/basic-zone-guest-ip-addresses.xml @@ -0,0 +1,9 @@ + + +%BOOK_ENTITIES; +]> +
+ Basic Zone Guest IP Addresses + When basic networking is used, CloudPlatform will assign IP addresses in the CIDR of the pod to the guests in that pod. The administrator must add a Direct IP range on the pod for this purpose. These IPs are in the same VLAN as the hosts. +
\ No newline at end of file diff --git a/docs/en-US/basic-zone-network-traffic-types.xml b/docs/en-US/basic-zone-network-traffic-types.xml new file mode 100644 index 00000000000..530fb0f641a --- /dev/null +++ b/docs/en-US/basic-zone-network-traffic-types.xml @@ -0,0 +1,17 @@ + + +%BOOK_ENTITIES; +]> +
+ Basic Zone Network Traffic Types + When basic networking is used, there can be only one physical network in the zone. That physical network carries the following traffic types: + + Guest. When end users run VMs, they generate guest traffic. The guest VMs communicate with each other over a network that can be referred to as the guest network. Each pod in a basic zone is a broadcast domain, and therefore each pod has a different IP range for the guest network. The administrator must configure the IP range for each pod. + Management. When &PRODUCT;’s internal resources communicate with each other, they generate management traffic. This includes communication between hosts, system VMs (VMs used by &PRODUCT; to perform various tasks in the cloud), and any other component that communicates directly with the &PRODUCT; Management Server. You must configure the IP range for the system VMs to use. + We strongly recommend the use of separate NICs for management traffic and guest traffic. + Public. Public traffic is generated when VMs in the cloud access the Internet. Publicly accessible IPs must be allocated for this purpose. End users can use the &PRODUCT; UI to acquire these IPs to implement NAT between their guest network and the public network, as described in Acquiring a New IP Address. + Storage. Traffic such as VM templates and snapshots, which is sent between the secondary storage VM and secondary storage servers. &PRODUCT; uses a separate Network Interface Controller (NIC) named storage NIC for storage network traffic. Use of a storage NIC that always operates on a high bandwidth network allows fast template and snapshot copying. You must configure the IP range to use for the storage network. + + In a basic network, configuring the physical network is fairly straightforward. In most cases, you only need to configure one guest network to carry traffic that is generated by guest VMs. If you use a NetScaler load balancer and enable its elastic IP and elastic load balancing (EIP and ELB) features, you must also configure a network to carry public traffic. &PRODUCT; takes care of presenting the necessary network configuration steps to you in the UI when you add a new zone. +
diff --git a/docs/en-US/physical-network-configuration-settings.xml b/docs/en-US/physical-network-configuration-settings.xml new file mode 100644 index 00000000000..e55098400cf --- /dev/null +++ b/docs/en-US/physical-network-configuration-settings.xml @@ -0,0 +1,18 @@ + + +%BOOK_ENTITIES; +]> +
+ Configurable Characteristics of Physical Networks + &PRODUCT; provides configuration settings you can use to set up a physical network in a zone, including: + + What type of network traffic it carries (guest, public, management, storage) + VLANs + Unique name that the hypervisor can use to find that particular network + Enabled or disabled. When a network is first set up, it is disabled – not in use yet. The administrator sets the physical network to enabled, and it begins to be used. The administrator can later disable the network again, which prevents any new virtual networks from being created on that physical network; the existing network traffic continues even though the state is disabled. + Speed + Tags, so network offerings can be matched to physical networks + Isolation method + +
diff --git a/docs/en-US/provisioning.xml b/docs/en-US/provisioning.xml index 17309583ee0..957bc1ef9c2 100644 --- a/docs/en-US/provisioning.xml +++ b/docs/en-US/provisioning.xml @@ -7,4 +7,4 @@ Provisioning Your Cloud Infrastructure - \ No newline at end of file + diff --git a/docs/en-US/system-reserved-ip-addresses.xml b/docs/en-US/system-reserved-ip-addresses.xml new file mode 100644 index 00000000000..aadd2d7d8f7 --- /dev/null +++ b/docs/en-US/system-reserved-ip-addresses.xml @@ -0,0 +1,20 @@ + + +%BOOK_ENTITIES; +]> +
+ System Reserved IP Addresses + In each zone, you need to configure a range of reserved IP addresses for the management network. This network carries communication between the CloudPlatform Management Server and various system VMs, such as Secondary Storage VMs, Console Proxy VMs, and DHCP. + The reserved IP addresses must be unique across the cloud. You cannot, for example, have a host in one zone which has the same private IP address as a host in another zone. + The hosts in a pod are assigned private IP addresses. These are typically RFC1918 addresses. The Console Proxy and Secondary Storage system VMs are also allocated private IP addresses in the CIDR of the pod that they are created in. + Make sure computing servers and Management Servers use IP addresses outside of the System Reserved IP range. For example, suppose the System Reserved IP range starts at 192.168.154.2 and ends at 192.168.154.7. CloudPlatform can use .2 to .7 for System VMs. This leaves the rest of the pod CIDR, from .8 to .254, for the Management Server and hypervisor hosts. + In all zones: + Provide private IPs for the system in each pod and provision them in CloudPlatform. + For KVM and XenServer, the recommended number of private IPs per pod is one per host. If you expect a pod to grow, add enough private IPs now to accommodate the growth. + In a zone that uses advanced networking: + For vSphere with advanced networking, we recommend provisioning enough private IPs for your total number of customers, plus enough for the required CloudPlatform System VMs. Typically, about 10 additional IPs are required for the System VMs. For more information about System VMs, see Working with System Virtual Machines in the Administrator's Guide. + When advanced networking is being used, the number of private IP addresses available in each pod varies depending on which hypervisor is running on the nodes in that pod. Citrix XenServer and KVM use link-local addresses, which in theory provide more than 65,000 private IP addresses within the address block. As the pod grows over time, this should be more than enough for any reasonable number of hosts as well as IP addresses for guest virtual routers. VMWare ESXi, by contrast uses any administrator-specified subnetting scheme, and the typical administrator provides only 255 IPs per pod. Since these are shared by physical machines, the guest virtual router, and other entities, it is possible to run out of private IPs when scaling up a pod whose nodes are running ESXi. + To ensure adequate headroom to scale private IP space in an ESXi pod that uses advanced networking, use one or more of the following techniques: + TODO +
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 1f831f9bb41..9d68679f057 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -412,32 +412,12 @@ public class LibvirtComputingResource extends ServerResourceBase implements return "scripts/storage/qcow2"; } - private void saveProperties(Map params) - throws ConfigurationException { - final File file = PropertiesUtil.findConfigFile("agent.properties"); - if (file == null) { - throw new ConfigurationException("Unable to find agent.properties."); + protected String getDefaultKvmScriptsDir() { + return "scripts/vm/hypervisor/kvm"; } - s_logger.info("agent.properties found at " + file.getAbsolutePath()); - - try { - Properties _properties = new Properties(); - _properties.load(new FileInputStream(file)); - Set names = _properties.stringPropertyNames(); - for (String key : params.keySet()) { - if (!names.contains(key)) { - _properties.setProperty(key, (String) params.get(key)); - } - } - _properties.store(new FileOutputStream(file), ""); - } catch (final FileNotFoundException ex) { - throw new CloudRuntimeException("Cannot find the file: " - + file.getAbsolutePath(), ex); - } catch (final IOException ex) { - throw new CloudRuntimeException("IOException in reading " - + file.getAbsolutePath(), ex); - } + protected String getDefaultDomrScriptsDir() { + return "scripts/network/domr/kvm"; } @Override @@ -458,16 +438,15 @@ public class LibvirtComputingResource extends ServerResourceBase implements + "com.cloud.storage.JavaStorageLayer"); } - _virtRouterResource = new VirtualRoutingResource(); - // Set the domr scripts directory - params.put("domr.scripts.dir", "scripts/network/domr/kvm"); - - success = _virtRouterResource.configure(name, params); + String domrScriptsDir = (String) params.get("domr.scripts.dir"); + if (domrScriptsDir == null) { + domrScriptsDir = getDefaultDomrScriptsDir(); + } String kvmScriptsDir = (String) params.get("kvm.scripts.dir"); if (kvmScriptsDir == null) { - kvmScriptsDir = "scripts/vm/hypervisor/kvm"; + kvmScriptsDir = getDefaultKvmScriptsDir(); } String networkScriptsDir = (String) params.get("network.scripts.dir"); @@ -480,6 +459,11 @@ public class LibvirtComputingResource extends ServerResourceBase implements storageScriptsDir = getDefaultStorageScriptsDir(); } + params.put("domr.scripts.dir", domrScriptsDir); + + _virtRouterResource = new VirtualRoutingResource(); + success = _virtRouterResource.configure(name, params); + if (!success) { return false; } @@ -633,8 +617,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements _localStorageUUID = (String) params.get("local.storage.uuid"); if (_localStorageUUID == null) { - _localStorageUUID = UUID.randomUUID().toString(); - params.put("local.storage.uuid", _localStorageUUID); + throw new ConfigurationException("local.storage.uuid is not set! Please set this to a valid UUID"); } value = (String) params.get("scripts.timeout"); @@ -649,8 +632,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements value = (String) params.get("host.reserved.mem.mb"); _dom0MinMem = NumbersUtil.parseInt(value, 0) * 1024 * 1024; - value = (String) params.get("debug.mode"); - LibvirtConnection.initialize(_hypervisorURI); Connect conn = null; try { @@ -662,9 +643,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements /* Does node support HVM guest? If not, exit */ if (!IsHVMEnabled(conn)) { throw new ConfigurationException( - "NO HVM support on this machine, pls make sure: " + "NO HVM support on this machine, please make sure: " + "1. VT/SVM is supported by your CPU, or is enabled in BIOS. " - + "2. kvm modules is installed"); + + "2. kvm modules are loaded (kvm, kvm_amd|kvm_intel)"); } _hypervisorPath = getHypervisorPath(conn); @@ -749,7 +730,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements } params.put("vm.migrate.speed", String.valueOf(_migrateSpeed)); } - saveProperties(params); return true; } 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/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index 65314980652..38153f30618 100755 --- a/server/src/com/cloud/user/AccountManagerImpl.java +++ b/server/src/com/cloud/user/AccountManagerImpl.java @@ -256,9 +256,6 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag s_logger.error("Unable to find an user authenticator."); } - //initialize admin context - UserContext.setAdminContext(new UserContext(getSystemUser().getId(), getSystemAccount(), null, false)); - return true; } 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/Encrypt.java b/utils/src/com/cloud/utils/db/Encrypt.java new file mode 100755 index 00000000000..4973458c686 --- /dev/null +++ b/utils/src/com/cloud/utils/db/Encrypt.java @@ -0,0 +1,32 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.utils.db; + +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * Encrypt is a replacement for the column modification. + */ +@Target(FIELD) +@Retention(RUNTIME) +public @interface Encrypt { + boolean encrypt() default true; +} 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/JoinType.java b/utils/src/com/cloud/utils/db/JoinType.java new file mode 100755 index 00000000000..6861925a509 --- /dev/null +++ b/utils/src/com/cloud/utils/db/JoinType.java @@ -0,0 +1,32 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.utils.db; + +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * JoinType is only used with SecondaryTable. Temporary solution. + */ +@Target(TYPE) +@Retention(RUNTIME) +public @interface JoinType { + String type() default "inner"; +} diff --git a/utils/src/com/cloud/utils/db/SqlGenerator.java b/utils/src/com/cloud/utils/db/SqlGenerator.java index 6af1a80521c..3b2d8cdf15e 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,12 @@ 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()); + JoinType jt = clazz.getAnnotation(JoinType.class); + String join = null; + if (jt != null) { + join = jt.type(); + } + addPrimaryKeyJoinColumns(innerJoin, tableName, st.name(), join, st.pkJoinColumns()); secondaryTables.add(st.name()); } @@ -566,7 +571,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. - -