Annotations are like meta-tags that you can add to the code and apply to package declarations, type declarations, constructors, methods, fields, parameters, and variables. They provide helpful ways to indicate whether the methods are dependent on other methods, whether they are incomplete, whether the classes have references to other classes, and so on.
Below is a list of Junos Space SDK annotations that can be used on EJB resources.
ANNOTATION | EXAMPLE | DESCRIPTION |
---|---|---|
@Cursor | @Cursor( entityClass = CountryEntity.CLASSNAME, queryName = CountryEntity.GET_ALL_COUNTRIES ) public PagingResult |
Applicable on an EJB method. This annotation enables
paging on EJB API variables. Variables:
|
@Filterable | @Filterable(entityAttrName = "country") public String getName() { return name; } |
Applicable on the getter/setter of an EJB managed
object class. This annotation enables filtering at the EJB
level. @Filterable provides the name of an attribute in a
JPA entity mapped to the attribute name in the managed
object that is used in creating the filtering query
criteria. Variables:
|
@JmpNotification | @JmpNotification(destination =
"topic/HelloWorldDatabaseChange") @XmlAccessorType(XmlAccessType.NONE) public class Country extends AbstractManagedObject implements Serializable {} |
Applicable on a managed object class in an EJB. This
annotation specifies that if there is any change in the
JPA entity of this managed object, the change should be
published on the topic provided as the destination value. Variables:
|
@JobData | @JobData( name = "Hello World Country Report", iconFileName = "HelloWorld_ui/jssdk/hello-world_job_countries_tree_265x315.png", detailsActionURL = "/mainui/ctrl/deviceScriptManagerWeb/CMPServlet? action=net.juniper.jmp.cems.deviceScriptManagerUI.action.ScriptMgmtJobReportBuilder", detailsActionType = "grid" ) @Schedulable @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public JobInfoTO runDeployScriptsOnDevices (Collection ScheduleContext sctx) { |
Applicable on schedulable APIs of an EJB. This
attribute is used to display the job scheduled by the
corresponding API of the EJB in the Junos Space UI. Variables:
|
@ManagedObject | @Table(name = "CountryEntity", uniqueConstraints = { @UniqueConstraint(columnNames = "country") }) @ManagedObject(value={"net.juniper.jmp.helloworld.ejb.Country"},uri="/api/space/HelloWorld/countries/{id}) public class CountryEntity extends OptimisticEntity |
Applicable on a JPA entity class. This annotation
specifies the name of a managed object class for a JPA
entity. Variables:
|
@Schedulable | @Schedulable @TransactionAttribute( TransactionAttributeType.REQUIRED ) public JobInfoTO getCountriesScheduledLRR(ScheduleContext scheduleCtx); throws Exception; |
Applicable on an EJB method. This annotation is used to
mark the methods that can be scheduled in the future. This
annotation is used by the job manager interceptor to push
scheduling information. Variables:
|
@Sortable | @Sortable(entityAttrName = "country") public String getName() { return name; } |
Applicable on the getter or setter of an EJB managed
object class. This annotation enables sorting at the EJB
level. @Sortable provides the name of the attribute in the
JPA entity mapped to the attribute name in the managed
object that will be used in creating the sorting query
criteria. Variables:
|