You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tomee.apache.org by bu...@apache.org on 2012/03/11 00:35:30 UTC
svn commit: r808161 - in /websites/staging/openejb/trunk: cgi-bin/ content/
content/examples-trunk/jpa-enumerated/README.html
content/examples-trunk/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Rating.java
Author: buildbot
Date: Sat Mar 10 23:35:30 2012
New Revision: 808161
Log:
Staging update by buildbot for openejb
Modified:
websites/staging/openejb/trunk/cgi-bin/ (props changed)
websites/staging/openejb/trunk/content/ (props changed)
websites/staging/openejb/trunk/content/examples-trunk/jpa-enumerated/README.html
websites/staging/openejb/trunk/content/examples-trunk/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Rating.java
Propchange: websites/staging/openejb/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sat Mar 10 23:35:30 2012
@@ -1 +1 @@
-1299304
+1299307
Propchange: websites/staging/openejb/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sat Mar 10 23:35:30 2012
@@ -1 +1 @@
-1299304
+1299307
Modified: websites/staging/openejb/trunk/content/examples-trunk/jpa-enumerated/README.html
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/jpa-enumerated/README.html (original)
+++ websites/staging/openejb/trunk/content/examples-trunk/jpa-enumerated/README.html Sat Mar 10 23:35:30 2012
@@ -259,7 +259,7 @@ public class Movies {
}
</code></pre>
-<h2><code>EnumType.STRING</code> vs <code>EnumType.ORDINAL</code></h2>
+<h2>EnumType.STRING vs EnumType.ORDINAL</h2>
<p>It is a matter of style how you would like your <code>enum</code> data represented in the database. Either <code>name()</code> or <code>ordinal()</code> are supported:</p>
@@ -272,7 +272,7 @@ public class Movies {
<p>There are advantages and disadvantages to each.</p>
-<h3>Disadvantage of <code>EnumType.ORDINAL</code></h3>
+<h3>Disadvantage of EnumType.ORDINAL</h3>
<p>A disadvantage of <code>EnumType.ORDINAL</code> is the effect of time and the desire to keep <code>enums</code> in a logical order. With <code>EnumType.ORDINAL</code> any new enum elements must be added to the
<strong>end</strong> of the list or you will accidentally change the meaning of all your records.</p>
@@ -285,7 +285,7 @@ public class Movies {
G,
PG,
R,
- UNRATED,
+ UNRATED
}
</code></pre>
@@ -312,7 +312,7 @@ public class Movies {
}
</code></pre>
-<p>If <code>EnumType.STRING</code> was used, then the enum could be reordered at anytime could instead look as we have defined it originally with ratings starting at <code>G</code> and increasing in severity to <code>NC17</code> and eventually <code>UNRATED</code>. With <code>EnumType.ORDINAL</code> the logical ordering would not have withstood the test of time as new values were added.</p>
+<p>If <code>EnumType.STRING</code> was used, then the enum could be reordered at anytime and would instead look as we have defined it originally with ratings starting at <code>G</code> and increasing in severity to <code>NC17</code> and eventually <code>UNRATED</code>. With <code>EnumType.ORDINAL</code> the logical ordering would not have withstood the test of time as new values were added.</p>
<p>If the order of the enum values is significant to your code, avoid <code>EnumType.ORDINAL</code></p>
Modified: websites/staging/openejb/trunk/content/examples-trunk/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Rating.java
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Rating.java (original)
+++ websites/staging/openejb/trunk/content/examples-trunk/jpa-enumerated/src/main/java/org/superbiz/jpa/enums/Rating.java Sat Mar 10 23:35:30 2012
@@ -17,11 +17,10 @@
package org.superbiz.jpa.enums;
public enum Rating {
-
- UNRATED,
G,
PG,
PG13,
R,
- NC17
+ NC17,
+ UNRATED
}