What is a View Attribute?

An attribute characteristic of an entity object or view object, implemented as a JavaBean property of the object class. An attribute can correspond to a database column, or be independent of a column. There are five kinds of attributes:

Attribute kind

Defined where?

Value derived from a database query?

Persisted in the database?

persistent

entity or view object level

yes

yes (the value outlives the class that created it)

transient

entity or view object level

no

no

entity-derived

view object level

no

no

SQL-derived

view object level

yes

no

dynamic

view object level, at runtime

no

no

Entity objects can have the following kinds of attributes:

When you first create an entity object using reverse generation, a persistent entity attribute is created for each table column. After, if you change the table, you need to manually change the attribute.

View objects can have the following kinds of attributes:

The value of a SQL-derived attribute is the result of a SQL statement. For example, a YearsOfService attribute might be the difference between an employee's hire date in the database and the current date. Alternatively, you could create a transient attribute and write code to perform a calculation in a Java file to set its value. In general, using SQL-derived attributes is more efficient than performing data-intensive calculations in Java.

In Business Components for Java, the term attribute is based on the UML definition, not the XML definition. In UML, an attribute is a named property of a class that describes a range of values that instances of that class might hold.