Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 31-01-2011
Member
 
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?
Reply With Quote
  #2  
Old 31-01-2011
Member
 
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.
Reply With Quote
  #3  
Old 31-01-2011
Member
 
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?
Reply With Quote
  #4  
Old 31-01-2011
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Windows Software
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to Customize Primary Key in Excel 2007"
Thread Thread Starter Forum Replies Last Post
Excel 2003 Macro doesn't work in Excel 2007 jjaw Windows Software 3 03-01-2014 03:28 PM
Excel 2007 file fails to get permission to open in Excel 2011 Raju Chacha Windows Software 6 13-01-2012 09:17 PM
How to check data validation compatibility of excel 2010 on excel 2007 Zoello Windows Software 6 17-05-2011 10:00 PM
Customize size limit of Exchange 2007 database Dwarner Windows Software 3 23-06-2009 10:11 PM
How to customize the look of the notes on Outlook 2007 ? EricTheRed Customize Desktop 0 27-01-2009 09:00 PM


All times are GMT +5.5. The time now is 02:34 PM.