web server - Borland Technical Publications
web server - Borland Technical Publications web server - Borland Technical Publications
Setting Properties Table 14.1 Navigation Tree Node/ Descriptor Element Panel Name DDEditor Tab Environment Entries Bean Environment EJB References to other Beans Bean EJB References EJB Links Bean EJB References Resource References to data Bean Resource References objects/connection factories Resource Reference type Bean Resource References Resource Reference Bean Resource References Authentication Type Security Role References Bean Security Role References Entity Properties Bean Properties Container Transactions Bean:Container Container Transactions Transactions Transactional Method Bean:Container Container Transactions Transactions Transactional Method Interface Bean:Container Container Transactions Transactions Transactional Attribute Bean:Container Container Transactions Transactions Method Permissions Bean:Method Permissions Method Permissions CMP Description Bean:CMP1.1 CMP 1.1 CMP Tables Bean:CMP1.1 CMP 1.1 Container-Managed Fields Bean:CMP1.1 CMP 1.1 Description Finders Bean:CMP1.1 Finders Finder Method Bean:CMP1.1 Finders Finder WHERE Clause Bean:CMP1.1 Finders Finder Load State option Bean:CMP1.1 Finders Container-managed data access support For container-managed persistence, the Borland EJB Container supports all data types supported by the JDBC specification, plus some other types beyond those supported by JDBC. The following table shows the basic and complex types supported by the Borland EJB Container: Basic types: boolean Boolean byte Byte char Character double Double float Float int Integer long Long short Short String java.sql.Date Complex types: J2EE 1.2 Entity Bean using BMP or CMP 1.1 (continued) BigDecimal java.util.Date byte[] java.sql.Time java.sql.TimeStamp Any class implementing java.io.Serializable, such as Vector and Hashtable Other entity bean references Keep in mind that the Borland Container supports classes implementing the java.io.Serializable interface, such as Hashtable and Vector. The container supports other data types, such as Java collections or third party collections, because they also implement java.io.Serializable. For classes and data types that implement the Serializable interface, the Container merely serializes their state and stores the result Chapter 14: Entity Beans and CMP 1.1 in Borland Enterprise Server 121
Setting Properties into a BLOB. The Container does not do any “smart” mapping on these classes or types; it just stores the state in binary format. The Container's CMP engine observes the following rule: the engine serializes as a BLOB all types that are not one of the explicitly supported types. In this context, the Container follows the JDBC specification: a BLOB is the type to which LONGVARBINARY maps. (For Oracle, this is LONG RAW.) Using SQL keywords The CMP engine for the Borland Container can handle all SQL keywords that comply with the SQL92 standard. However, you should keep in mind that vendors frequently add their own keywords. For example, Oracle uses the keyword VARCHAR2. If you want to ensure that the CMP engine can handle vendor keywords that may differ from the SQL standard, set up an environment property in the deployment descriptor that maps the CMP field name to the column name. By using this sort of environment property, you do not have to modify your code. For example, suppose you have a CMP field called “select”. You can use the following environment property to map “select” to a column called “SLCT”, as shown below. Data select SLCT Using null values It is possible that your database values can contain SQL null values. If so, you must map them to fields whose Java data types are permitted to contain Java null values. Typically, you do this by using Java types instead of primitive types. Thus, you use a Java Integer type rather than a primitive int type, or a Java Float type rather than a primitive float type. Establishing a database connection You must specify a DataSource so that the CMP engine can open a database connection. The DataSource defines the information necessary for establishing a database connection, such as username and password. Define a DataSource and then use a resource-ref to refer to the DataSource in the XML deployment descriptor for the bean. The CMP engine can then use the DataSource to access the database via JDBC. At the point in the vendor-specific XML file where you provide the jndi binding for the resource-ref, add the element True For cases where the entity bean declares only one resource-ref, you do not need to provide the above XML element. When the entity bean has only one resource-ref, the Borland Container knows to automatically choose that one resource as the cmpresource. Container-created tables You can instruct the Borland EJB Container to automatically create tables for container-managed entities based on the entity's container-managed fields. Because table creation and data type mappings vary among vendors, you must specify the JDBC database dialect in the deployment descriptor to the Container. For all 122 BES Developer’s Guide
- Page 81 and 82: Configuring your Apache web server
- Page 83 and 84: Configuring your Apache web server
- Page 85 and 86: Web Services and Partitions ■ ■
- Page 87 and 88: Web Service providers Java:RPC prov
- Page 89 and 90: How Borland Web Services work
- Page 91 and 92: Packaging Web Service Application A
- Page 93 and 94: Tools Overview Java2WSDL tool Note
- Page 95 and 96: 84 BES Developer’s Guide
- Page 97 and 98: Client view of an enterprise bean L
- Page 99 and 100: Client view of an enterprise bean E
- Page 101 and 102: Managing transactions Managing tran
- Page 103 and 104: Support for JNDI Support for JNDI T
- Page 105 and 106: EJB to CORBA mapping A CORBA progra
- Page 107 and 108: 96 BES Developer’s Guide
- Page 109 and 110: Application Client architecture Pac
- Page 111 and 112: Document Type Definitions (DTDs) my
- Page 113 and 114: Support of references and links The
- Page 115 and 116: Use of Manifest files Use of Manife
- Page 117 and 118: 106 BES Developer’s Guide
- Page 119 and 120: Sessions in secondary storage If yo
- Page 121 and 122: 110 BES Developer’s Guide
- Page 123 and 124: Container-managed persistence and R
- Page 125 and 126: Implementing an entity bean Generat
- Page 127 and 128: Container-Managed Persistence in Bo
- Page 129 and 130: Container-Managed Persistence in Bo
- Page 131: Setting Properties Setting Properti
- Page 135 and 136: Setting Properties Automatic table
- Page 137 and 138: 126 BES Developer’s Guide
- Page 139 and 140: Container-managed persistence and R
- Page 141 and 142: Container-Managed Persistence in Bo
- Page 143 and 144: Container-Managed Persistence in Bo
- Page 145 and 146: Container-Managed Persistence in Bo
- Page 147 and 148: Container-Managed Persistence in Bo
- Page 149 and 150: Container-Managed Persistence in Bo
- Page 151 and 152: Container-Managed Persistence in Bo
- Page 153 and 154: 142 BES Developer’s Guide
- Page 155 and 156: Setting Properties J2EE 1.3 Entity
- Page 157 and 158: Setting Properties Figure 16.2 Edit
- Page 159 and 160: Setting Properties Table 16.1 ejb.m
- Page 161 and 162: Setting Properties Table 16.3 Table
- Page 163 and 164: Setting Properties Security Propert
- Page 165 and 166: Aggregate Functions in EJB-QL Selec
- Page 167 and 168: Support for ORDER BY Support for OR
- Page 169 and 170: Overriding SQL generated from EJB-Q
- Page 171 and 172: Container-managed data access suppo
- Page 173 and 174: 162 BES Developer’s Guide
- Page 175 and 176: Generating primary keys from a cust
- Page 177 and 178: Implementing primary key generation
- Page 179 and 180: Transaction manager services Consis
- Page 181 and 182: Transaction manager services When t
Setting Properties<br />
Table 14.1<br />
Navigation Tree Node/<br />
Descriptor Element<br />
Panel Name<br />
DDEditor Tab<br />
Environment Entries Bean Environment<br />
EJB References to other Beans Bean EJB References<br />
EJB Links Bean EJB References<br />
Resource References to data Bean<br />
Resource References<br />
objects/connection factories<br />
Resource Reference type Bean Resource References<br />
Resource Reference<br />
Bean<br />
Resource References<br />
Authentication Type<br />
Security Role References Bean Security Role References<br />
Entity Properties Bean Properties<br />
Container Transactions<br />
Bean:Container<br />
Container Transactions<br />
Transactions<br />
Transactional Method<br />
Bean:Container<br />
Container Transactions<br />
Transactions<br />
Transactional Method Interface Bean:Container<br />
Container Transactions<br />
Transactions<br />
Transactional Attribute<br />
Bean:Container<br />
Container Transactions<br />
Transactions<br />
Method Permissions Bean:Method Permissions Method Permissions<br />
CMP Description Bean:CMP1.1 CMP 1.1<br />
CMP Tables Bean:CMP1.1 CMP 1.1<br />
Container-Managed Fields<br />
Bean:CMP1.1 CMP 1.1<br />
Description<br />
Finders Bean:CMP1.1 Finders<br />
Finder Method Bean:CMP1.1 Finders<br />
Finder WHERE Clause Bean:CMP1.1 Finders<br />
Finder Load State option Bean:CMP1.1 Finders<br />
Container-managed data access support<br />
For container-managed persistence, the <strong>Borland</strong> EJB Container supports all data types<br />
supported by the JDBC specification, plus some other types beyond those supported<br />
by JDBC.<br />
The following table shows the basic and complex types supported by the <strong>Borland</strong> EJB<br />
Container:<br />
Basic types: boolean Boolean byte Byte char Character<br />
double Double float Float int Integer<br />
long Long short Short String java.sql.Date<br />
Complex types:<br />
J2EE 1.2 Entity Bean using BMP or CMP 1.1 (continued)<br />
BigDecimal<br />
java.util.Date<br />
byte[]<br />
java.sql.Time<br />
java.sql.TimeStamp<br />
Any class implementing java.io.Serializable, such as Vector and<br />
Hashtable<br />
Other entity bean references<br />
Keep in mind that the <strong>Borland</strong> Container supports classes implementing the<br />
java.io.Serializable interface, such as Hashtable and Vector. The container supports<br />
other data types, such as Java collections or third party collections, because they also<br />
implement java.io.Serializable. For classes and data types that implement the<br />
Serializable interface, the Container merely serializes their state and stores the result<br />
Chapter 14: Entity Beans and CMP 1.1 in <strong>Borland</strong> Enterprise Server 121