HQL & JPAQuery for Springboot => https://drive.google.com/drive/u/1/folders/18KA0A0EKYmn6Z7auazNquPDaweqPQvHI https://www.baeldung.com/jpa-join-types (only if we want to write join query, but in HQL no need of using join key word , if we can correctly implement the mapping classes ) Native SQL for Springboot => https://drive.google.com/drive/u/1/folders/17vdDhEXBKtbWpTkYUy5UcF_n_r2G-YDy projects => https://drive.google.com/drive/folders/14x_9TeE5SZq6ECZqCmoBaGTgOUSssuqm?usp=sharing We can write plan SQL Query in hibernate using session.createSQLQuery(sqlSearch); Eg-:: String sqlSearch = SQLVarList.MSSQL_DEVICEOPERATIONREPORT_SQL2 + where + orderBy; Query querySearch = session.createSQLQuery(sqlSearch); querySearch = setD...
Observer Design Pattern According to GoF definition, observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. It is also referred to as the publish-subscribe pattern . In observer pattern, there are many observers (subscriber objects) that are observing a particular subject (publisher object). Observers register themselves to a subject to get a notification when there is a change made inside that subject. A observer object can register or unregister from subject at any point of time. It helps is making the objects objects loosely coupled . 1. When to use observer design pattern As described above, when you have a design a system where multiple entities are interested in any possible update to some particular second entity object, we can use the observer pattern The flow is very simple to understand. Application creates the concrete subject object. All...
COMPOSITION TUTORIAL The term composition is not unique to Java, composition is a concept of object-oriented programming. By now you should be familiar with the concept of inheritance - inheritance requires the use of the Java keywords extends or implements . When your class inherits members from either a superclass or a superinterface, you can directly invoke or access those members. Consider the following code that demonstrates inheritance: class OperatingSystem { void bootUp() { ... } void shutDown() { ... } } class Computer extends OperatingSystem { } class TestMe { public static void main(String args[]){ Computer c = new Computer(); c.bootUp(); ...
Comments
Post a Comment