Source Code Cross Referenced for SConstants.java in  » Database-ORM » SimpleORM » simpleorm » core » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » SimpleORM » simpleorm.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package simpleorm.core;
002:
003:        import simpleorm.properties.*;
004:
005:        /*
006:         * Copyright (c) 2002 Southern Cross Software Limited (SCSQ).  All rights
007:         * reserved.  See COPYRIGHT.txt included in this distribution.
008:         */
009:
010:        /** Contains all the constants used by SimpleORM.  Implementing this
011:         interface will automatically import these constants which is
012:         convenient.  All constants are prefixed to avoid conflicts.<p>
013:
014:         Bit fields are longs to alow for growth and to trap type errors if
015:         they are mixed up with other int parameters.  For flags, the low order
016:         short is used to verfiy the parameter -- each flag set has a different
017:         lower short.  Parameters that use them are named *_flags where * is the
018:         prefix, eg. sfd_bitSet.<p>
019:
020:         Wouldn't it be wonderful if Java supported 30 year old constructs such
021:         as enumerations and sets!<p>
022:
023:         Constants and methods suffixed <code>_unimp</code> have not yet been
024:         implemented.  When they are, the suffix will be removed.<p> */
025:
026:        public interface SConstants extends SSimpleORMProperties {
027:
028:            // static final String SIMPLEORM_VERSION Moved to SUte due to Java bugs.
029:
030:            // ## Should validate.  Also, option for non Create Table not null.
031:            //static final long SFD_GROUP_1     = ; // user defined groupings.
032:            //static final long SFD_GROUP_2     = ;
033:
034:            /** SQY_: SimpleORM QuerY flags.  Controls which fields are queried,
035:                and how.*/
036:            static final long SQY_ = 0x00000200;
037:
038:            /** Causes only the primary key field(s) are queried.  At least the
039:                primary key field(s) are always queried. */
040:            static final long SQY_PRIMARY_KEY = 0x00010200;
041:
042:            /** Only query fields marked <code>SFD_DESCRIPTIVE</code>. */
043:            static final long SQY_DESCRIPTIVE = 0x00020200;
044:
045:            /** Include any columns that were marked SFD_UNQUERIED and so are not
046:                normally retrieved. */
047:            static final long SQY_UNQUERIED = 0x00040200;
048:
049:            /* Only query fields marked SFD_GROUP_1 or _2.  Primary keys are
050:               always queried.  */
051:            //static final long SQY_GROUP_1     = 0x00100200;
052:            //static final long SQY_GROUP_2     = 0x00200200;
053:            /** Do not lock the record in the database.  Must not be updated
054:                unless subsequently requeired without this flag set.
055:                See SQY_UNREPEATABLE_READ */
056:            static final long SQY_READ_ONLY = 0x00800200;
057:
058:            /** Use Optimistic locking.  Ie. do not lock the record in the
059:                database, but do remember the previous state of the row.  If the
060:                record is updated a check is made that the row has not been
061:                updated by another session.*/
062:            static final long SQY_OPTIMISTIC = 0x01000200;
063:
064:            /** Retrieve the row from the Read Mostly cache.  Use with caution
065:                because the returned row might be quite stale.  Must not be
066:                updated.*/
067:            static final long SQY_READ_MOSTLY_unimp = 0X02000200;
068:
069:            /** Internal for DataLoader.  Do not include Foreign key column
070:                fields, just the references.*/
071:            static final long SQY_NO_FOREIGN_KEYS = 0X04000200;
072:
073:            /** Internal for queries.  Do not include Reference fields, just
074:                the fields that correspond to columns. */
075:            static final long SQY_NO_REFERENCES = 0X08000200;
076:
077:            /** Internal for queries.  Do not include any generated keys. */
078:            static final long SQY_NO_GENERATED_KEYS = 0X10000200;
079:
080:            /** Optimization parameter to findOrCreate that causes SimpleORM to
081:                assume that the the record does not already exist in the
082:                database, and so does not do the initial <code>SELECT</code>.
083:                Saves about 30%.  If the record does in fact exist you will get a
084:                duplicate key error when the record is flushed. */
085:            static final long SQY_ASSUME_CREATE = 0X20000200;
086:
087:            /**
088:             * Prevents a query from being issued to lazzily fetch a reference.
089:             * getObject just returns Boolean.FALSE in this case.  See
090:             * getReferenceNoQuery.
091:             */
092:            static final long SQY_REFERENCE_NO_QUERY = 0x40000200;
093:
094:            /**
095:             * Read without locking the record with a read lock.
096:             * Important for MS SQL to prevent lock escalation.
097:             * For read behind dbs like Oracle/Postgresql this is the same as SQY_Read_Only
098:             * in that no "FOR UPDATE" is appended, yet the record is still updatable
099:             * (The read actually will probably be repeatable).<p>
100:             * 
101:             * Note that this still enables the record to be updated.
102:             * This is very dangerous unless you are <b>sure</b> that no other 
103:             * user could be accessing the records.
104:             * Eg. Detail records related to a master.<p>
105:             * 
106:             * But if you get this wrong you will get unrepeatable data
107:             * corruption.
108:             * See SQY_UNREPEATABLE_READ.
109:             * And consider using optimistic locks if this really is a problem for you.
110:             */
111:            static final long SQY_UNREPEATABLE_READ_UNSAFE = 0x80000200;
112:            /**
113:             * Read without locking the record with a read lock.  
114:             * It is also Read_Only.<p>
115:             * 
116:             * Note that it is still not really safe if you are using read
117:             * data to update another record.<p>
118:             * 
119:             * Important for MS SQL to prevent lock escalation.
120:             * Has no effect for read behind dbs like Oracle/Postgresql.
121:             */
122:            static final long SQY_UNREPEATABLE_READ = SQY_UNREPEATABLE_READ_UNSAFE
123:                    | SQY_READ_ONLY;
124:
125:            /** Values of SRecordInstance.bitSets -- ie. internal. */
126:            static final byte INS_VALID = 0x01; // ie. Has been queried.
127:            static final byte INS_READ_ONLY = 0x02; // ie. queried for update.
128:            static final byte INS_DIRTY = 0x04;
129:            // ie. has been set.  But also may be true for primary keys iff they
130:            // were retrieved via findOrCreate (vs select).
131:
132:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.