[Original] EJB composite primary key custom rules! ! !

xiaoxiao2021-03-06  51

EJB composite primary key custom rules! ! !

1. In most cases, the primary key should be a string class, an integer class or other standard belonging to J2SE or J2EE.

2. If the bean has a composite primary key, you must create a primary key class 3. A primary key must implement java.io.serializable interface 4. The access control of the primary key must be public5. All domains of this class must be declared as public6 This class has a public default constructor 7. This class is to implement Hascode () and equals () methods

Public class pk imports java.io.serializable {public string f1, f2; // CMP Fieldpublic pk ()} public int haascode () {} public boolean equals ()}}}

转载请注明原文地址:https://www.9cbs.com/read-118116.html

New Post(0)