Menu

AEM Sling Model injection and annotation

In this article, we will understand what all are the ways to reading authored values of AEM component using sling model in AEM

Using ValueMapValue annotation of package org.apache.sling.models.annotations.injectorspecific

@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL)
private String classStartDateLabel;

Using Inject annotation of package javax.inject


@Inject
@Via("resource")
@Optional
private String classStartDateLabel;


Getter method for this injection


public String getClassStartDateLabel() {
return classStartDateLabel;
}

sun.misc - cannot be resolved | AEM Bundle

sun.misc -- Cannot be resolved but is not required and overwritten by Boot Delegation

Resolution

This error we see sometimes while installing bundle in Adobe Experience Manager(AEM). If you are seeing this error just after the installation of the package then wait for a few minutes to resolve the dependencies. Most of the time it will resolve automatically as soon as the dependent library or service will available. After a few minutes if this is not getting resolved then check your POM and ensure you are adding the correct dependency which is available in the system.

Cursor in PLSQL

 The cursor is a private work area for an SQL statement, when the SQL statement is executed in PL/SQL block, the Oracle engine assigns a private work area for that statement. The cursor stores the statement and result after execution.

There are two types of Cursor implicit cursor and explicit cursor.

Example of Implicit Cursor

DECLARE

    var datatype

BEGIN

    select * from table; // Your SQL statement

END;


Example of Explicit Cursor

DECLARE

             CURSOR cursor_name is

                select * from table;    // Your SQL statement 

BEGIN

    OPEN cursor_name; 

        FETCH cursor_name  // Your SQL statement

            CLOSE cursor_name; 

END;


Reference

 Cursor overview | Oracle Doc