With CMP enitity beans we have to assign a primary key. Now i can definitely store primitive values in the fields. Like i may have a field count and declare it int type. So question is that can i also make count as my primary key. Does it alwayz have to be a class, cant i use primitive values in it.
For container-managed persistence, a primary key class must meet the following requirements:
* The access control modifier of the class is public. * All fields are declared as public. * The fields are a subset of the bean's persistent fields. * The class has a public default constructor. * The class implements the hashCode() and equals(Object other) methods. * The class is serializable.
Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz Exam 1Z0-810: Upgrade to Java SE 8 Programmer Study Guide and Quiz