[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-403) Improve Java 5 Enums dependency on old fashioned enums
Amir Pashazadeh (JIRA)
noreply at atlassian.com
Tue Feb 13 17:49:40 EST 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-403?page=comments#action_26101 ]
Amir Pashazadeh commented on ANN-403:
-------------------------------------
well it makes converting from Java 5 enums to old enums a direct process instead of set of if-else-ifs or a switch case.
I've tested for performance, it was just a small performance improvement, so it can't be the real means for this improvement.
but it will be cleaner code, a accessor instead of a list of if-else-ifs.
> Improve Java 5 Enums dependency on old fashioned enums
> ------------------------------------------------------
>
> Key: ANN-403
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-403
> Project: Hibernate Annotations
> Type: Improvement
> Versions: 3.2.0.cr1
> Reporter: Amir Pashazadeh
> Priority: Minor
>
> Original Estimate: 2 hours
> Remaining: 2 hours
>
> Converting from new enum types (like FlushModeType and CacheModeType) to old enum types (which is used by Query, Critiera, and ... interfaces) is not done well, and well formed.
> By adding constructors to new enums this could be much better, and more perform!
> I will attach what must have been done in FlushModeType, the same thing must happen to CacheModeType:
> public enum FlushModeType {
> /**
> * see {@link org.hibernate.FlushMode.ALWAYS}
> */
> ALWAYS(FlushMode.ALWAYS),
> /**
> * see {@link org.hibernate.FlushMode.AUTO}
> */
> AUTO(FlushMode.AUTO),
> /**
> * see {@link org.hibernate.FlushMode.COMMIT}
> */
> COMMIT(FlushMode.COMMIT),
> /**
> * see {@link org.hibernate.FlushMode.NEVER}
> */
> NEVER(FlushMode.NEVER);
> FlushModeType(FlushMode flushMode) {
> this.flushMode = flushMode;
> }
> private FlushMode flushMode;
> /**
> * @return old type proper FlushMode
> */
> public FlushMode getFlushMode() {
> return flushMode;
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list