Adding an External Entity Type to OData Service
You can add an external entity type to an existing OData service or while creating a new OData service.
For instruction on how to create an OData service using Designer, refer to "Working with OData Services" chapter in the webMethods Service Development Help.
Once you select a connection from the list of configured Connection Alias, Adapter for JDBC retrieves the list of database tables in the current catalog. You can add the database tables associated with the connection as external entity type to the OData service. These entity types are displayed in schema_TableName format in Designer.
In Designer, when you select an external entity type, Adapter for JDBC retrieves the properties for that entity type. You can configure the Java Data Type for the respective property. Each Java Data Type is mapped to a corresponding EDM Type. The mapping between Java Data type to EDM Type is shown below:
Java Type Name | Java Type | EDM Type |
InputStream | java.io.InputStream | String |
ARRAY | java.sql.Array | String |
BOOLEAN | java.lang.Boolean | Boolean |
SQLTIMESTAMP | java.sql.Timestamp | DateTimeOffset |
LONG | java.lang.Long | Int64 |
STRING | java.lang.String | String |
INT | java.lang.Integer | Int32 |
SHORT | java.lang.Short | Int16 |
DATE | java.util.Date | DateTime |
BLOB | java.sql.Blob | Binary |
CLOB | java.sql.Clob | String |
FLOAT | java.lang.Float | Single |
SQLDATE | java.sql.Date | DateTime |
DOUBLE | java.lang.Double | Double |
SQLTIME | java.sql.Time | Time |
BIGDECIMAL | java.math.BigDecimal | Decimal |
BYTESEQ | java.lang.Byte | Binary |
BYTE | java.lang.Byte | SByte |
SQLXML | java.sql.SQLXML | String |
Note:
![*](chapterTOC_bullet.png)
You can make a property as key for the tables that do not have the primary key defined in the database. This can be done using the OData Sync feature.
![*](chapterTOC_bullet.png)
For MSSQL server, do not make entity property as a key which has SQL datatype nchar, as it may append extra character space in OData response link tag.