Re: About Question enthuware.oce-jpad.v6.2.559 :
Posted: Wed Jan 04, 2017 11:04 am
If property is not field, then what is it?
Java Certification Resources and Java Discussion Forum
http://enthuware.com/forum/
First of all, by definition the statement itself is contradictory - if you say property access it means that there are no fields in the Entity class, because "fields" are technically properties (promoted to properties from fields if you will by virtue of property accessor or/and mutator existense).If a property based access is chosen for an entity class, the names of the fields do not have to correspond to the method names.
And you are sayingIt is required that the entity class follow the method signature conventions for JavaBeans read/write properties (as defined by the JavaBeans Introspector class) for persistent properties when property access is used.
In this case, for every persistent property property of type T of the entity, there is a getter method, getProperty, and setter method setProperty. For boolean properties, isProperty may be used as an alternative name for the getter method.
For single-valued persistent properties, these method signatures are:
• T getProperty()
• void setProperty(T t)
and referring to Oracle glossary https://docs.oracle.com/javase/tutorial ... ary.html#Pproperty != variable/field.
Since you are referring to this definition, note it does not say here HOW 'characteristic of an object is set', i.e. as long as it is being set by user it is a property.property
Characteristics of an object that users can set, such as the color of a window.
Code: Select all
private int xxx;
public int getA(){
return xxx;
}