How do we map a CDT to a database view??/ Any documentation related to vie

Certified Senior Developer
How do we map a CDT to a database view??/
Any documentation related to views & CDT is very helpful.
We tried creating a CDT with annotations but it creates a table in the DB. Is there any extra anootations / tags we need to take crae for views. We have created a view in the database in MS SQL....

OriginalPostID-76078

OriginalPostID-76078

  Discussion posts and replies are publicly visible

Parents
  • Hi, Raghu. A couple things.

    If the table name is different from the CDT name, add an @Table(name = "<tableName>").
    If any CDT field names are different from the table column names, add an @Column(name = "<tableColumnName>").
    If one of your CDT fields should be a primary key, add an @Id annotation to that field in the CDT.
    If your primary key should be autogenerated, add an @GeneratedValue annotation that that field in the CDT.

    Hope this helps!
Reply
  • Hi, Raghu. A couple things.

    If the table name is different from the CDT name, add an @Table(name = "<tableName>").
    If any CDT field names are different from the table column names, add an @Column(name = "<tableColumnName>").
    If one of your CDT fields should be a primary key, add an @Id annotation to that field in the CDT.
    If your primary key should be autogenerated, add an @GeneratedValue annotation that that field in the CDT.

    Hope this helps!
Children
No Data