‘basic’ attribute type should not be ‘persistence entity’

Explanation:

The ‘basic’ attribute is used to define a basic persistent field or property for an entity class. It represents a simple value that can be stored in the database. However, the ‘basic’ attribute type should not be set as ‘persistence entity’.

Here is an example to clarify:

<Entity name="Product">
  <Attributes>
    <Basic name="name" attributeType="persistence entity" />
    <Basic name="price" attributeType="double" />
    <Basic name="description" attributeType="string" />
  </Attributes>
</Entity>

In the above example, the ‘name’ attribute has been incorrectly set with the attributeType as ‘persistence entity’, which is not allowed for a basic attribute. The correct attributeType for ‘name’ should be ‘string’ or some other appropriate data type.

Read more interesting post

Leave a comment