Thursday, June 3, 2021

AWS how to delete VPC when it has error with Network interface , Gateway decencies

 

 how to delete VPC when it has error with Network interface , Gateway decencies  in AWS

1. Check if it is running on EC2 instance then Stop / Terminate that first

2.  Deassociate Elastic IP

3. Detach and delete NAT gateway

4. Detach and Delete Internet gateway

5. Delete security group (optional)

Back to delete VPC again 










Tuesday, March 16, 2021

Hibernate 3 to 5 migration


 Hibernate 3 to 5 migration 

Some notes and tips:

 by Pseudo code below


1.       1.       Typical current code  

 

getCurrentSession().createCriteria(BT.class)

                                                                .add(Restrictions.eq("replacedBT", replaced))

                                                                .addOD(OD.desc("id")).list();

 

Will be replaced by

 

CriteriaQuery<BT> criteriaQuery = getCurrentSession().getCriteriaBuilder().createQuery(BT.class);

Root<BT> root = criteriaQuery.from(BT.class);

CriteriaBuilder cb = getCurrentSession().getCriteriaBuilder();

criteriaQuery.select(root).where(getCurrentSession().getCriteriaBuilder().equal(root.get("replacedBT"), replaced));

criteriaQuery.ODBy(cb.desc(root.get("id")));

 

 

2.       Mapping

 

 

Hibernate

JPA

1

setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY)

criteriaQuery.select(root).distinct(true)

2

setProjection(Property.forName("id")

criteriaQuery.multiselect(root.get("id"))

 

 

 

3

Disjunction

CriteriaBuilder  disjunction();

Ex:

Predicate predicate = cb.disjunction();

predicate.getExpressions().add(cb.isNull(root.get("effectiveEndDate")));

predicate.getExpressions().add(cb.greaterThanOrEqualTo(root.get("effectiveEndDate"), DateUtil.getLienDateForTestY(testY.intValue())));

4

Criterion

predicate.getExpressions().add(

5

Restrictions.in ("testY", Ys)

root.get("testY").in(Ys)

 

 

 

6

Restrictions.le

lessThanOrEqualTo

7

Restrictions.ilike   - case insensitive

cb.like(cb.lower(root.get("assesseeName")), "%"+name.trim().toLowerCase() + "%"

8

Build list of conditions many if else

List<Predicate> predicates = new ArrayList<>();

                                                        predicates.add(join.get("testId").in(oidSub));

                                                        predicates.add(cbSub.notEqual(rootBT.get("pmStatus"), BTPmStatus.paidStatus));

                                                        predicates.add(cbSub.notEqual(rootBT.get("status"), TestBTStatus.canceled));

                                                        predicates.add(cbSub.notEqual(rootBT.get("status"), TestBTStatus.purged));

                                                        predicates.add(cbSub.notEqual(rootBT.get("status"), TestBTStatus.rolledToUnsecured ));

9

Join

 

                                                BTCrit.createCriteria("testCharges","chg");

                                                BTCrit.add (Restrictions.in("chg.testId", oidSub) );

                                                Join<BT, Charge> join = rootBT.join("testCharges", JoinType.INNER);

                                                criteriaQueryBT.select(rootBT).where(join.get("testId").in(oids),

                                                                                                                                                                                                                 cbBT.equal(rootBT.get("testY"), testY),

                                                                                                                                                                                                                 rootBT.get("BTType").in(types)  );

10

Multiple Join

 

                                List<JTestOD> chains =

                                    getCurrentSession()

                                    .createCriteria(JTestOD.class)

                                .add(Restrictions.not(Restrictions.eq("state", JTestODState.open)))

                                .createCriteria("traTranss")

                                .createCriteria("JTransProperties")

           .add(Restrictions.eq("id.apn",prop.getPropertyId()))            .add(Restrictions.eq("propertyAvTestY",prop.getTestY()))

//           .add(Restrictions.eq("chainedToTestOD", co))

//                            .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY)

//                            .list();

                CriteriaQuery<JTestOD> criteriaQuery = getCurrentSession().getCriteriaBuilder().createQuery(JTestOD.class);

        CriteriaBuilder cb = getCurrentSession().getCriteriaBuilder();

        Root<JTestOD> root = criteriaQuery.from(JTestOD.class);

       

        Join<JTestOD, JTraTrans> join = root.join("traTranss", JoinType.INNER);

        Join<JTraTrans, JTransProperty> join2 = join.join("JTransProperties", JoinType.INNER);

        

        criteriaQuery.select(root).distinct(true) .where(

                               cb.notEqual(root.get("state"), JTestODState.open),

                               cb .equal(join2.get("id").get("apn"), prop.getPropertyId()),

                               cb.equal(join2.get("propertyAvTestY"), prop.getTestY()),

                               cb .equal(join2.get("chainedToTestOD"), co));

       

        List<JTestOD> chains  = getCurrentSession().createQuery(criteriaQuery).getResultList();

 

Hibernate 3 to Hibernate 5 migration

Hibernate 3 to Hibernate 5 migration  Tips and Steps


Package name changes


org.hibernate.internal.ThreadLocalSessionContext->org.hibernate.context.internal.ThreadLocalSessionContext
org.hibernate.connection.ConnectionProvider --> org.hibernate.engine.jdbc.connections.spi.ConnectionProvider
org.hibernate.cfg.AnnotationConfiguration -> org.hibernate.cfg.Configuration
org.hibernate.event.PostLoadEvent -> org.hibernate.event.spi.PostLoadEvent
org.hibernate.event.def.DefaultPostLoadEventListener -> org.hibernate.event.internal.DefaultPostLoadEventListener

Friday, March 8, 2019

Multiple authentication mechanism chaining in OAM: Card 2FA authentication

Multiple authentication mechanism chaining in OAM: Card 2FA authentication

http://www.ateam-oracle.com/multiple-authentication-mechanism-chaining-in-oam/

Tuesday, February 19, 2019

Banner : after block in is populate detail

Banner : : after block in is populate detail

Ellucian banner : Search by name in keyblock


Ellucian banner : Search by name in keyblock

Order of struct is for Next item default, and search by name need ID next to Name

Ellucian Banner: Put activity_date at status bar


Ellucian Banner: Put activity_date at status bar

Put activity_date at status bar
 <Item CanvasName="MAIN_CANVAS" Id="SZRRECM_ACTIVITY_DATE" Required="true" Type="TextItem" Enabled="false">
            <Extension Name="CopyTo" Value="BANNER_FOOTER_DATA.ACTIVITY_DATE"/>
            </Item>

Error LOV error outside of block in Ellucian Banner 9

Error LOV error outside of block in Ellucian Banner 9

LOV error outside of block : key ibt need same name with id key
ex: ID  and ID_IBT

Ellucian banner: how to get rid of the warning Query Caused No records to be retrieved

Ellucian banner: how to get rid of the warning Query Caused No records to be retrieved


how to get rid of the warning Query Caused No records to be retrieved -- Re-enter?
MessageServices.setMessageLevel(FormsMessageLevel.decodeMessageLevel("5")); // 5-USER's Msg

But have to set it back to default after the action is done:

MessageServices.setMessageLevel(FormsMessageLevel.decodeMessageLevel("0")); // 0--ALL

Ellucian Banner : Pagination

Ellucian Banner : Pagination

in model xml

<pagination maximumRows="3" enabled="true"/>

Ellucian banner: Dialog box, message box


Ellucian banner: Dialog box, message box

with OK
getTask().getGoqrpls().gDisplayErrMsg(
toStr("Income Type on all accounting records must be equal to"
+ " the Income Type on Header. Change Header Income Type"
+ " via Header Additional Information on Tools Menu") );



No OK
errorMessage(GNls.Fget(toStr("FYAINVE-0517"), toStr("FORM"), toStr("Document Text must exist for Direct Pay Invoices. Completion not allowed.")));

Banner : append before="*" after="rect67"



<x:append before="*" after="rect67">
   <v:component label="* Press F3 for Transaction Detail(FGITRND); Shift+F2 for Budget Status(FGIBSUM); F4 for Encumbrance List(FGIOENC)">
   </v:component>
</x:append>

Ellucian Banner: set record status, get record status

Ellucian Banner: set record status, get record status

System.out.println(" getRecordStatus 2 " +  getRecordStatus());

TaskServices.setRecordStatus("", "");

System.out.println(" getRecordStatus 2 " +  getRecordStatus());

//TaskServices.setRecordStatus("", "");
//fabinvhElement.acceptChanges();


//GbCommon.pCommit();
//fabinvhElement.acceptChanges();

setBlockRecordStatus("FABINVH", getCursorRecord(), Status.NEW);

BlockServices.setBlockRecordStatus("FTVVEND", BlockServices.getCurrentRecord(), Status.NEW);

getGlobal("QUERY_MODE").equals("1"))

setGlobal("QUERY_MODE", toStr("0"));

Ellucian Banner: Default load value

Ellucian Banner: Default load value


<item name="FTVVEND_COLLECT_TAX" logicalName="ftvvendCollectTax" type="String" physicalName="FTVVEND_COLLECT_TAX"   >
<value>
<constant>A</constant>
</value>
</item>
<item name="FTVVEND_TAX_FORM_STATUS" logicalName="ftvvendTaxFormStatus" type="String" physicalName="FTVVEND_TAX_FORM_STATUS">
<value>
<constant>A</constant>
</value>
</item>
<item name="FTVVEND_TAX_FORM_DATE" logicalName="ftvvendTaxFormDate" type="java.util.Date" physicalName="FTVVEND_TAX_FORM_DATE"   >
<value>
<systemVariable name="DBDATE"/>
</value>
</item>

Ellucian Banner 9: Missing IN or OUT parameter. Add new item field

Ellucian Banner 9: Missing IN or OUT parameter, Add new item field

Struct

<Item AllowSearch="true" CanvasName="FABINVH_HEADER" Id="FABINVH_VEND_INV_CODE" MaxLength="15" Type="TextItem"/>


XVC

<textbox autoskip="true" block="FABINVH" case="upper" datatype="String" height="23px" keyactions="NEXT_ITEM" label="fabinvh.fabinvhVendInvCode.prompt" maxlength="15" member="FABINVH_VEND_INV_CODE" name="fabinvhVendInvCode" validation="server" width="120px" style="ui-hidelabel">


FORM

@ActionTrigger(action="HOLD_LAST_ITEM_LOC")
public void Fyainve_HoldLastItemLoc()
{

// DECLARE
//  hold_last_text_item VARCHAR2(30);
// BEGIN
// DECLARE
//  hold_last_text_item VARCHAR2(30);
// BEGIN
getFormModel().getFormHeader().setHoldLastTextItem(toStr(getCursorItem()));


CONTROLLER

@ActionTrigger(action="POST-TEXT-ITEM", item="FABINVH_VEND_INV_CODE", function=KeyFunction.ITEM_OUT)
public void fabinvhVendInvCode_itemOut()
{
    System.out.println(" fabinvhVendInvCode_itemOut");

    executeAction("HOLD_LAST_ITEM_LOC");
}



@ActionTrigger(action="KEY-NEXT-ITEM", item="FABINVH_VEND_INV_CODE", function=KeyFunction.NEXT_ITEM)
public void fabinvhVendInvCode_keyNexItem()
{
System.out.println(" fabinvhVendInvCode_keyNextItem ");
nextItem();
//    GO_FIELD( 'FABINVH_ACH_OVERRIDE_IND' ) ;
getTask().getGoqrpls().gCheckFailure();
}

Wednesday, January 23, 2019

how to access virtualbox share folder in Linux


how to access virtualbox share folder in Linux 

sudo mount -t vboxsf -o uid=1000,gid=1000 development ~/share

Monday, January 21, 2019

Resize VirtualBox disk , change virtual machine disk of Ubuntu/Windows

Resize VirtualBox disk , change virtual machine disk

ex: change vm disk to 40000mb

C:\Program Files\Oracle\VirtualBox>vboxmanage modifyhd "C:\Users\oracle\VirtualBox VMs\Ubuntu18\Ubuntu18.vdi" --resize 40000


Then

Start VM
Login to Ubuntu
Run DiskUtility
Resize Linux partition


Same with Windows
Start VM
Login to Windows
Run DiskManager
Resize Windows partition

Tuesday, November 6, 2018

Uninstall Oracle 12c database completely in easiest way


Uninstall Oracle 12c database completely in easiest way

If you have 12c installer package available or you can download from Oracle.com

Navigate to that folder where setup file is

run command line

cd C:\Users\xxx\Downloads\winx64_12201_database\database

setup.exe -deinstall -home C:\app\oracle\product\12.1.0\dbhome_1

Answer some questions:

LISTENER is LISTENER
Dataabase name is ORCL by default
ASM / FS  : ASM
final process is Y





AWS how to delete VPC when it has error with Network interface , Gateway decencies

   how to delete VPC when it has error with Network interface , Gateway decencies  in AWS 1. Check if it is running on EC2 instance then Sto...