8 The Oracle Entity Framework Data Provider : Mapping Data Types and Functions

Mapping Data Types and Functions
Mapping Oracle Data Types to Simple Types
In Table 8-4, the columns are defined as follows:
The OracleDbType column refers to the Oracle data provider’s type enumeration. Generally, there is a one to one mapping between the native type and the OracleDbType.
The SSDL column refers to data types used by the store schema definition language (SSDL) file. The storage metadata schema is a formal description of the database that persists data for an application built on the EDM.
 
NUMBER(5<=p<=9,0)
NUMBER(10<=p<=18,0)
NUMBER(p, s <>0)6
NUMBER(p>18,s)

1
Only supported on Oracle 10g and higher.

2
The maximum precision of the EDM DateTime simple type is milliseconds. Because the Oracle data type Date has no notion of milliseconds, round trip integrity cannot be be guaranteed.

3
The Oracle documentation strongly discourages the use of the Long and Long Raw data types.

4
Supports AL16UTF and UTF-8 seamlessly.

5
Where p represents the precision.

6
Where p represents the precision and s represents the scale.

Table 8-5 shows the mapping of EDM Simple Types to Oracle data types. The columns are defined as follows:
The SSDL column refers to data types used by the store schema definition language (SSDL) file. The storage metadata schema is a formal description of the database that persists data for an application built on the EDM.
 
Number(5<=p<=9,0)
Number(10<=p<=18,0)

1
The Oracle documentation strongly discourages the use of the Long Raw data type.

2
Where p represents the precision.

Mapping EDM Canonical Functions to Oracle Functions
The ADO.NET Entity Framework translates the Entity Data Model (EDM) canonical functions to the corresponding data source functionality for the ADO.NET Oracle Entity data provider. The function invocations are expressed in a common form across data sources.
Because these canonical functions are independent of data sources, argument and return types of canonical functions are defined in terms of types in the EDM. When an Entity SQL query uses canonical functions, the appropriate function is called at the data source.
Both null-input behavior and error conditions are explicitly specified for all canonical functions. However, the ADO.NET Entity Framework does not enforce this behavior. Further details are available at:
http://msdn.microsoft.com/en-us/library/bb738626.aspx
Aggregate Canonical Functions
Table 8-6 describes the mapping of EDM aggregate canonical functions to Oracle functions.
Avg(expression)
avg(expression)
BigCount(expression)
count(expression)
Count(expression)
count(expression)
Max(expression)
max(expression)
Min(expression)
min(expression)
StDev(expression)
stdev_samp(expression)
Sum(expression)
sum(expression)
Math Canonical Functions
Table 8-7 describes the mapping of EDM math canonical functions to Oracle functions.
Abs(value)
abs(value)
Ceiling(value)
ceil(value)
Floor(value)
floor(value)
Round(value)
round(value, 0)
Date and Time Canonical Functions
Table 8-8 describes the mapping of EDM date and time canonical functions to Oracle functions.
Year(expression)
Month(expression)
Day(expression)
Hour(expression)
Minute(expression)
Second(expression)
Millisecond(expression)
GetTotalOffsetMinutes(DateTime Offset)
Bitwise Canonical Functions
Table 8-9 describes the mapping of EDM bitwise canonical functions to Oracle functions.
BitWiseAnd (value1, value2)
bit_and (value1, value2)
BitWiseOr (value1, value2)
BitWiseXor (value1, value2)
String Canonical Functions
Table 8-10 describes the mapping of EDM string canonical functions to Oracle functions.
Concat(string1, string2)
concat(string1, string2)
IndexOf(target, string2)
instr(target, string2)
Left(string1, length)
Length(string)
length(string)
LTrim(string)
ltrim(string)
Trim(string)
Replace(string1, string2, string3)
replace(string1, string2, string3)
Reverse(string)
RTrim(string)
rtrim(string)
Substring(string, start, length)
ToLower(string)
lower(string)
ToUpper(string)
upper(string)