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?
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.
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?
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.