Results 1 to 4 of 4

Thread: How to Customize Primary Key in Excel 2007

  1. #1
    Join Date
    Jan 2011
    Posts
    40

    How to Customize Primary Key in Excel 2007

    I have installed the Microsoft Excel 2007 on my machine and I want help regarding the primary key on this software. Actually I am working in the private company which in fact works for the government. I am maintaining some secret data due to which it is important to make it very much clear from all the aspects. There is one field that I want to format as a primary key as well as a foreign key?

  2. #2
    Join Date
    May 2008
    Posts
    860

    Re: How to Customize Primary Key in Excel 2007

    The change you want to perform more like a reorganization (functional) of several tables in a database. Indeed it is a question of substituting the primary key column of the parent table "direction" (column relative who happens to be foreign key in several other dependent tables), another column of that table. The column not renewed in the table "direction." Note about this last assumption: Several are probably related to the same (And .......... a primary key does not allow duplicates) . If this is the case and to get round that should be retained in the primary key suffix, the column which thereby provide a single new primary key, which will be comprised of columns: In this case it would be a permutation of columns, or more precisely a change in the primary key.

  3. #3
    Join Date
    Apr 2010
    Posts
    83

    Re: How to Customize Primary Key in Excel 2007

    I try to create a link table for foreign key to which its primary key. My two keys must have the same name. Or is arrive get two keys with different names, or a key that is both primary and foreign key but that does not bear the name I want.

    Code:
     
     @ Entity
     @ Table (name = "TASK")
     public class Task implements Serializable {
    
     @ Id
     @ Column (name = "task_id", length = 36)
     private String task_id;
    
     @ OneToOne (mappedBy = "task", cascade = {CascadeType. ALL})
     Private Barrage_JT barrageJT;
     ...
    and in my other class I have:
    Code:
     @ Entity
     @ Table (name = "BARRAGE_JT)
     public class implements Serializable {Barrage_JT
    
     @ Id
     @ Column (name = "task_id")
     private String task_id;
    
     OneToOne @ (fetch = fetchType. EAGER)
     private Task task;
     ...
    in this case I find myself with a primary key and foreign key task_id TASK_TASK_ID, but if I change the name of the column in the class Barrage_JT, although I find myself with but a single column named TASK_TASK_ID. Or should my key apelle task_id.

    Can you help me?

  4. #4
    Join Date
    Nov 2008
    Posts
    1,022

    Re: How to Customize Primary Key in Excel 2007

    is a reflexive association you're looking to do? If yes, I do not see why you did 2 classes, one is enough. This class could be:

    Code:
     public class MyClass implements Serializable
     {
           @ Id
           @ GeneratedValue (strategy = GenerationType. Indentity)
           private int id;
    
           @ Column (name = "myColumn)
           private String name;
    
           @ ManyToOne
           @ JoinColumn (name = "myclass_fk)
           private int id_fk;
    
           / * 
            .... 
            Following the code  
            .... 
            * /
     }
    Furthermore, I strongly advise you not to use a String for an identifier. A long or int is recommended (especially on "rules" of setting up a database described in Merise but that's another topic). Especially since it is easier to use these types for auto-generation with the annotation @ GeneratedValue.

Similar Threads

  1. Excel 2003 Macro doesn't work in Excel 2007
    By jjaw in forum Windows Software
    Replies: 3
    Last Post: 03-01-2014, 03:28 PM
  2. Excel 2007 file fails to get permission to open in Excel 2011
    By Raju Chacha in forum Windows Software
    Replies: 6
    Last Post: 13-01-2012, 09:17 PM
  3. Replies: 6
    Last Post: 17-05-2011, 10:00 PM
  4. Customize size limit of Exchange 2007 database
    By Dwarner in forum Windows Software
    Replies: 3
    Last Post: 23-06-2009, 10:11 PM
  5. How to customize the look of the notes on Outlook 2007 ?
    By EricTheRed in forum Customize Desktop
    Replies: 0
    Last Post: 27-01-2009, 09:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,142,604.33310 seconds with 17 queries