How to deal with a legacy schema when using Oracle Before Insert Trigger for ID generation in Hibernate

We are using Oracle. For a given table we have a primary key which is set by a trigger before an insert is performed, for example: CREATE OR REPLACE TRIGGER Table_name_TRG BEFORE INSERT ON Table_name REFERENCING NEW AS New OLD AS Old FOR EACH ROW BEGIN :new.ID := Sequence_name.nextval; END Table_name_TRG; The trigger simply calls a ...

Read More

Overridden and overloaded methods in Java

Just a short post to illustrate the rules of overriding or overloading a method in Java. A deep understanding of this powerful Java mechanisms is a basic skill for every Java developer (as well as OOP and OOD proficiency) Let's start with an example. package eu.albertomorales.OCAOCP.threads.example3; public class Rectangle { ...

Read More

Don’t rely on inherited code, keep your eyes open

There is a cost to making mistakes when coding, and the cost of not dealing with these mistakes will increase over time. Do you remember the technical debt metaphor? We don’t really know how much debt we have taken on – you may have taken on a lot of unintentional technical debt – and you may still be taking it on without knowing it. ...

Read More
Situación tras el arreglo

Optimización de un servicio WEB

Antecedentes. Uno de mis ocupaciones es auditoría y optimización de aplicaciones. Realizaba esto ya en el año 95, sobre un 4GL y BDD relacional Multibase. Ahora, casi 20 años más tarde, J2EE+Oracle, pero se encuentran las mismas burradas carencias en el código, y es que yo opino que si no tienes la cabeza amueblada, la tecnología no te ...

Read More