Error "Entity creation failed for the following Database Object. No primary key attributes and does not support ROWID" Occcurs when Creating Business Components on Views Accessing Types

(Doc ID 1123357.1)

Last updated on AUGUST 04, 2016

Applies to:

Oracle JDeveloper - Version: 11.1.1.2.0 and later   [Release: and later ]
Information in this document applies to any platform.

Symptoms

Using JDeveloper 11.1.1.X (i.e. 11.1.1.2, 11.1.1.3) the following error occurs when trying to create update able View Objects where is it accessing a database View.


Business Components:
Save error -View1
Entity creation failed for the following Database Object. No primary key
attributes and does not support ROWID. Use the Entity Wizard to create the
Entity Object.
VIEW1


Steps to Reproduce

  • Below is a sample database script which reproduces the issue.
    CREATE OR REPLACE TYPE type1
    AS
    OBJECT
    (
    ID NUMBER,
    DATE_TEST DATE,
    COL1 VARCHAR2(1),
    COL2 NUMBER );
    /

    CREATE OR REPLACE TYPE type2
    AS
    TABLE OF type1;
    /

    CREATE OR REPLACE PACKAGE package1 AS
    FUNCTION function1
    RETURN type2;
    END package1;
    /

    CREATE OR REPLACE PACKAGE BODY package1 AS
    var1 type2;
    FUNCTION function1
    RETURN type2
    IS
    BEGIN
    RETURN var1;
    END function1;

    --
    BEGIN
    var1:=type2( type1( ID => 1, DATE_TEST => SYSDATE, COL1 =>'N', COL2 => 1 ) );
    END package1;
    /

    CREATE OR REPLACE FORCE VIEW view1
    ( ID,DATE_TEST,COL1,COL2 ) AS
    SELECT t.ID ID,
    t.DATE_TEST DATE_TEST,
    t.COL1 COL1,
    t.COL2 COL2
    FROM TABLE(package1.function1) t;
    /

  • In JDeveloper create a Fusion Application or Generic Application (that contains ADF Business Components technologies defined).
  • Select File | New | Business Tier | ADF Business Components | Business Components from Tables and press [OK].
  • Initialize Project for Business Components dialog: select/create database connection.
  • Create Business Components from Tables wizard
    • Entity Objects page: Press [Query] and select a database View i.e. View1 in this testcase.
    • Updatable View Objects page: must select an VO here.
    • Press [Finish].
  • The above error will appear.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms