How to do hibernate mapping for table or view without a primary key

Hi,
Anyone knows how to do hibernate mapping for table or view without a primary key?
thanks.
cc

or you can make all column primary key .Anybody seriously considering that as a good idea should understand the implications:
1. this requires that each row be unique - that's a minor issue normally, but can be a significant problem in some cases
2. in practically all databases, a primary key constraint creates a unique index - this has many implications:
a) in most databases, the index stores a copy of the column data that is indexed - this suggestion therefore more than doubles the data storage required for the data
b) whenever an indexed column is changed, the index has to be maintained - this suggestion then more than doubles the work that each UPDATE statement has to do, since both the table and the index have to be maintained for any UPDATE at all
This might work OK for toy projects, but it doesn't scale well at all...

Similar Messages

  • How to speed up fast refresh of materialized view without primary key

    Thought I'd share this info, as I couldn't find anything on here to help me diagnose the issue:
    I had a materialized view that was taking longer to perform a fast refresh than it took to perform a complete refresh. My mview had no primary key, as the base table had no primary key.
    I created a trace file for the session and saw references to a column M_ROW$$ in my mview. Nowhere in the data dictionary could I find a reference to the m_row$$ column in my mview, but apparently it exists and is created automatically. After creating the index below, the fast refresh took 6 minutes to add 500k rows to the materialized view. (versus 4+ hours without the index) When I looked in the trace file, I noticed that for each row in the mview log, it first tries to update the mview with an UPDATE statement, then it performs an insert of the new data. Seems like it should be able to determine whether to perform an update or insert based on the DMLTYPE$$ column of the mview log. What was killing my performance was the UPDATE phase. Since I had no primary key on the mview, and no index on the m_row$$ column, the UPDATE phase was performing a full table scan of my mview for every row in the mview log. I was expecting it to be smart enough to only perform inserts, as the only transactions against the base table were inserts.
    In summary: If you have a materialized view without a primary key, create an index on the m_row$$ column of the mview, even though no such column displays in the data dictionary.
    ex:
    CREATE MATERIALIZED VIEW mv_minidrr ...
    CREATE INDEX pk_mv_minidrr ON mv_minidrr(m_row$$) ...

    Well, there indeed is a column called M_ROW$$
    Your MLOG$_EMP is nothing but the materialized view log on the base table.
    SQL> create  materialized view log on emp with rowid ;
    Materialized view log created.
    SQL> create materialized view emp_mview refresh fast on demand with rowid as select * from emp ;
    Materialized view created.
    SQL> desc mlog$_emp
    Name                                                  Null?    Type
    M_ROW$$                                                        VARCHAR2(255)
    SNAPTIME$$                                                     DATE
    DMLTYPE$$                                                      VARCHAR2(1)
    OLD_NEW$$                                                      VARCHAR2(1)
    CHANGE_VECTOR$$                                                RAW(255)
    SQL> select table_name, column_name from user_tab_columns where column_name = 'M_ROW$$' ;
    TABLE_NAME                     COLUMN_NAME
    MLOG$_EMP                      M_ROW$$
    1 row selected.
    SQL>

  • How to integrate bing map for including or displaying multiple locations at the same time

    how to integrate bing map for including or displaying multiple locations at the same time

    Have you aware of the geolocation field that's been introduced with SharePoint 2013?  You can store location data within a list and then integrate this within Bing.  The second tutorial on this Bing team blog will show it well.
    https://www.bing.com/blogs/site_blogs/b/maps/archive/2013/03/26/connecting-a-sharepoint-list-to-bing-maps.aspx
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • How to create a record for table PLAF with order type 'NB'.

    How to create a record for table PLAF with order type 'NB'(standard purchase order).
    who can tell me the T-code or some usefull information?
    Thanks.

    Hi
    This will be updated automatically when generate planned orders thru MRP. (MD02)
    regards
    Srinivas

  • How to hide a field from table maintenance view?

    Hi,
    How to hide a field from table maintenance view? 
    The field is used for data created date. I need to hide it from display.
    Thanks

    Chk this link.
    http://help.sap.com/saphelp_nw04/helpdata/en/66/33f52010dd11d6999300508b5d5211/frameset.htm
    Maintenance Attributes
    You can assign a maintenance attribute P to individual fields in the maintenance view definition in the Dictionary (SE11). It can be  H (hidden)
    H (hidden)
    A field flagged H is not displayed on the screen. This field must also be filled in the background by a routine at an event.
    The system writes R and H fields to the database like all other fields when a new data record is saved.

  • How to get column names for a specific view in the scheme?

    how to get column names for a specific view in the scheme?
    TIA
    Don't have DD on the wall anymore....

    or this?
    SQL> select text from ALL_VIEWS
      2  where VIEW_NAME
      3  ='EMP_VIEW';
    TEXT
    SELECT empno,ename FROM EMP
    WHERE empno=10

  • How do i disable orientations for a specific view in my tab bar project without disabling for the other views?

    How do i disable orientations for a specific view in my tab bar project without disabling for the other views?
    Any suggestions?

    Note that you can also hide the tab bar completely with code in the userChrome.css file.
    Add code to the <b>userChrome.css</b> file below the default @namespace line.
    *http://kb.mozillazine.org/userChrome.css
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #TabsToolbar { display: none !important; }
    </nowiki></pre>
    The customization files userChrome.css (user interface) and userContent.css (websites) are located in the <b>chrome</b> folder in the Firefox profile folder.
    *http://kb.mozillazine.org/Editing_configuration

  • How to create apple id for mac app store without using credit card and there is no any option for payment none. please tell how to download free apps from mac app store

    how to create apple id for mac app store without using credit card and there is no any option for payment none. please tell how to download free apps from mac app store

    my problem solve by me
    first create apple id
    fill credit card details
    and complete your account creating  process.
    than go to app store or itune store
    login your acount
    click right side  - account button
    than again login for account setting
    next go to payment information and click edit button
    when u enter payment infomation
    click none button in payment method and click done button.
    than ur credit card has been removed.
    but rs. 60 will deducted in your account when u doing this process.

  • Hi All,How2 delete a pkey for std table and add 2 new primary keys

    Hi All,
            How2 delete a pkey for std table and add 2 new primary key fields .Please provide me the required procedure .
    Thanks&Regards.
    Bharat.

    Hi Bharat,
    First thing is you need to have the access key to change any standard dictionary object/standard programs/ standard transactions.You may get this from your basis person after getting approval from your respective manager.But changing or modifying the standard object is not recommended, but if there is no alternate to meet the business requirement then we have to follow this way only.
    Next, you need to check whether this table's primary key is being used in any other table as foreing key or not. If there is, then you must remove this relation and then you can delete the unncessary primary key field from that table.Finally you can add the two new fields and set them as primary key, save, check for any errors and activate.
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • Testing for unique records in a compound Primary Key table

    I have a table with 2 fields being primary keys. I want to write a sql script to check if there are duplicates.
    Here is what I have but not sure if this is working right. I have table with millions of records.
    SELECT COUNT(CASE WHEN A.AUNQ >1  THEN 1 ELSE NULL END)
    FROM
    SELECT (List_Cd + Account_Key) PK_ListAcc, COUNT(List_Cd) AUNQ
    FROM RAW_AML_LISTEDACCNTS_JUN GROUP BY List_Cd, Account_Key HAVING (COUNT(List_Cd) >1))
     A;
    Can someone help?
    thanks

    Yes, I agree. I am doing data profiling and testing all these tables. I am expecting that the results show me zero, however, if there were any problems with the settings, then I should get something. I think that the subquery is needed because if I used
    what you suggested above I will get the following:
    List_CD    Account_Key
    1                    a
    2                    b
    3                    c
    3                    C
    1                    a
    1                    a
    the results will be:
    List_CD    Account_Key    CountOFAccount_Key
    1                    a                       
    3
    3                    C                       
    2
    I now need to count that query results to get the total which should be 2
    do you agree? I am just trying to confirm that the sql script I listed will give me this result correctly.

  • VLD-0201:Table has more than one primary key

    hi
    i'm working with OWB 9.2,I was imported the table from database,when i validating that it is giving message:
    VLD-0201:Table has more than one primary key
    vld-0209:Duplicate unique key i.e:cust_acc and SYS_C00435 detected.
    Can i use this table and generate the mapping with out any errors?
    Any help will be very generate.

    Hi Ashok,
    I'm quite curious how you managed to get a table with 2 PK's.
    I tried it myself:
    =======================================================
    SQL>create table x(c1 number constraint pk1 primary key,c2 number constraint pk2 primary key, c3 date);
    create table x(c1 number constraint pk1 primary key,c2 number constraint pk2 primary key, c3 date)
    ERROR at line 1:
    ORA-02260: table can have only one primary key
    SQL>ed
    Wrote file afiedt.buf
    1* create table x(c1 number constraint uk1 unique,c2 number constraint uk2 unique, c3 date)
    SQL>/
    Table created.
    =====================================================
    As you can see, trying to create a table with more than 1 PK is impossible. With Unique Key, that IS possible (see second example).
    I don't expect mappings to function properly with such an error message.
    Is it possible for you to drop the table in the database, correct the definition of the table in OWB and then deploy that corrected version to the database?
    If on the other hand the table on the database is correct (i.e. has only one PK) then the import into OWB obviously did not go well and I'd suggest you drop the imported definition and try to import it again.
    Cheers, Patrick

  • Need to create a new row in table with same data as Primary key, but new PK

    Hello Gurus ,
    I have a table with one column as primary key, I need to create a new row in the table, but with same data as in one of the rows, but with different primary key, in short a duplicate row with diferent primary key ..
    Any ideas of how it can be done without much complication?
    Thanks in advance for your reply.
    Reards,
    Swapneel Kale

    user9970447 wrote:
    Hello Gurus ,
    I have a table with one column as primary key, I need to create a new row in the table, but with same data as in one of the rows, but with different primary key, in short a duplicate row with diferent primary key ..
    Any ideas of how it can be done without much complication?
    Thanks in advance for your reply.
    Reards,
    Swapneel Kalesomething like
    insert into mytable values ('literal for new pk',
                                           select non-pk-1,
                                                    non-pk-2,
                                                    non-pk-n
                                           from mytable
                                           where pk-col = 'literal for existing pk')

  • Error remote table does not contain a primary key

    I make replication between oracle and Microsoft sql using getway for sql but when I insert to table in oracle I get this error in apply process
    information :
    ASD.SUBHI.COM is database link from oracle to microsoft sql
    "DBO"."REGIONS" name of the table
    CREATE TABLE regions (a INTEGER primary key) command to create table
    error
    ORA-26711: remote table does not contain a primary key constraint ORA-26712: remote object is "DBO"."REGIONS"@"ASD.SUBHI.COM"
    Note: I go to sql server and verify that primary key is creates
    is this the best place to like this question ?
    if you need more details please tell me I need the answer

    I make replication between oracle and Microsoft sql using getway for sql but when I insert to table in oracle I get this error in apply process
    information :
    ASD.SUBHI.COM is database link from oracle to microsoft sql
    "DBO"."REGIONS" name of the table
    CREATE TABLE regions (a INTEGER primary key) command to create table
    error
    ORA-26711: remote table does not contain a primary key constraint ORA-26712: remote object is "DBO"."REGIONS"@"ASD.SUBHI.COM"
    Note: I go to sql server and verify that primary key is creates
    is this the best place to like this question ?
    if you need more details please tell me I need the answer

  • How to use simple types for table column names ?

    Hi,
    can any one tell how to to use simple types for table column names?
    It is required in internationalizing of webdynpro applications.
    Regards,
    Rajesh

    Hi,
    1: define required column names in <SimpleType>
    2:use the following code to get those values
    3:bind 'text' property of Column headers to context attributes
    4:take a context attribute 'Value' as type of <SimpleType>
    5:set these values to context attributes
    IWDAttributeInfo objAttrInfo=wdContext.getNodeInfo().getAttribute(IPrivate<ViewName>View.IContextElement.VALUE);
    ISimpleTypeModifiable simple=objAttrInfo.getModifiableSimpleType();
    Map m=simple.getEnumerationTexts();
    Collection c=m.values();
    Iterator it=c.iterator();
    if(it.hasNext())
    wdContext.currentContextElement.set<att1>(it.next().toString);
    if(it.hasNext())
    wdContext.currentContextElement.set<att2>(it.next().toString);
    if(it.hasNext())
    wdContext.currentContextElement.set<att3>(it.next().toString);
    Regards
    LakshmiNarayana

  • How to create a transaction for table maintanence?

    Hi Experts,
      How can i create a transaction for insert/modify/delete entries for a table?

    Hi,
    First u nee dto create Table maintenace genaertor for that table.
    go to se11.--> table name --> change
    Mebu options: > Utilities> table maintenace gen (or Tcode SE55)
    Fill the following
    Authorisation group : &NC&( or group specified by Functiopnal owner)
    Function group:
    Maintrenace type: 1 step
    Maint screen: 6
    SAVE.
    Now after craeting Table maintenace genarator, u haveto attach tcode.
    Go to SE93
    Give ur tcode  for table.
    Check : Transaction with parameters.
    continue...
    Transaction :   SM30
    check SKIP INITIAL SCREEN
    Check all the check boxes of GUI support.
    under Name of screen field :
    TABLE VIEW             : table name
    UPDATE                    : X
    Rvert back if nay issues.
    Reward with oints if helpful.
    Regards,
    Naveen.

Maybe you are looking for

  • HT3705 How do I save a Pages document to jpeg so that I can share on social media?

    I have created a brochure and would like to post it on Facebook. How do I save a Pages document to jpeg so that I can share on social media and email? Do I have to save it as a jpeg or what other format can I save it in?

  • Acrobat 10 - I can't see the comments in the comment list

    So I have received a pdf back from a client with comments. I know they are inserted right as I can see them in the comment list in adobe reader. However, when I open it in my Adobe Acrobat 10, I can see the comment icon in the pdf and I can read them

  • .tagx Tag files in Weblogic 9.2

    Hi,           We are trying to run one of our applications deploying it to a Weblogic Server 9.2. We are running into problems, as we use .tagx tag files and they do not seem to be recognized. Our .jsp page tries to invoke them as:                   

  • Cannot export quicktime movie from iPhoto

    latest imac (brand new) iphoto slideshow... when i try to export a slideshow as a quicktime movie...it renders the quicktime movie...then when it goes into the "saving" phase...it just keeps saving and never ends... but it will let me save a high qua

  • Hp6500 imac not detecting

    I have an HP 6500 and an iMac.  The two machines have worked fine for several years.  But now the scan function is no longer working on the HP 6500--I get a message that "no scanner is detected"  Any help will be appreciated.