For example, if a class name length exceeds the valid object identifier length in Oracle Database then the ORA-00972: identifier is too long exception will be raised at object creation time.įor the remaining objects, ODP.NET utilizes a name generation algorithm if the supplied name length exceeds the database identifier length limit. These object names must conform to the object identifier length limits for Oracle Database. Sequences and triggers may be created in Oracle Database 11 g Release 2 and earlier databases to support identity columns.įor objects which directly relate to a client application object, namely, a table which represents an application class and a table column which represents a class property, the object names used are those provided by the client. Note: There is no Data Annotation equivalent for HasPrecision. Indicates the precision and scale for a decimal property. Note: There is no Data Annotation equivalent for IsUnicode. Indicates to create the column as an N-type, that is, nvarchar2 or nclob. Use the TypeName property with the Column Data Annotation to specify the type. For example a Date property is not legal to map to a number column. Indicates the provider-specific type to use for the database column. Indicates to create the column as a rowversion column. Use of a LOB column in the concurrency check will result in an ORA-00932: inconsistent datatypes error. Note: Do not use with an unbounded (no maximum length specified) string property as this will create a LOB column. Indicates the column should be used for optimistic concurrency checking. Indicates the property is not mapped to a database column. Specifies the maximum length of the property. The following table illustrates the available functionality: For additional information regarding the use of Data Annotations and the Code First Fluent API refer to the MSDN Entity Framework documentation. Data Annotations permit you to explicitly mark a class property with one or more attributes, whereas the Code First Fluent API permits you to use code rather than attributes to achieve the same goal. ![]() There are two Entity Framework methods to influence the resulting Oracle Data Type: Data Annotations and the Code First Fluent API. As illustrated with the String type, you can influence the resulting Oracle Data Type for a property as well as characteristics of that data type. The type mappings listed in the previous table represent the mappings that occur by default or what is known as convention in Entity Framework. Influencing the Oracle Data Type Characteristics ![]() If the character data can be longer than 4000 bytes, it may be more appropriate to use CLOB or NCLOB column. As such, these columns may not be able to store 4000 characters even if Max Length is set to 4000 characters since one character may require multiple number of bytes of storage, depending on the data and the database character set. However, due to the Oracle database limit, these columns can store only up to 4000 bytes. The character based columns, namely, CHAR, NCHAR, VARCHAR2, NVARCHAR2 will be created using character semantics to be able to store the specified Max Length amount of characters. Set Column Type to UROWID using HasColumnType() fluent API or Column data annotation Set Column Type to ROWID using HasColumnType() fluent API or Column data annotation Note: The long data type is deprecated and not recommended. Set Column Type to LONG using HasColumnType() fluent API or Column data annotation Set Max Length to <= 2000 using HasMaxLength() fluent API or MaxLength annotation and Set Column Type to CHAR using HasColumnType() fluent API or Column data annotation Set Max Length to <= 1000 using HasMaxLength() fluent API or MaxLength annotation and Set Column Type to NCHAR using HasColumnType() fluent API or Column data annotation Set Max Length to <= 4000 using HasMaxLength() fluent API or MaxLength data annotation and set Unicode to false using IsUnicode() fluent API Set Max Length to <= 2000 using HasMaxLength() fluent API or MaxLength data annotation Set Unicode to false using IsUnicode() fluent API Reference the EDM Mapping sections in the documentation for additional information. Note: The default mapping of integer types may be specified in the EDM Mapping configuration. ![]() ![]() Note: Requires use of EDM Mapping configuration.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |