Saturday, 29 December 2018

Inner class is a class defined inside other class and act like a member of the enclosing class. There are two main types of inner classes Static member class Inner class Member class Anonymous class Local class Static member class A static member class behaves much like an ordinary top-level class, except that it can access the static members of the outer.  Outer class can access all inner class fields by referring...

Friday, 21 December 2018

ACID Properties in DBMS? A transaction is a single logical unit of work which accesses and possibly modifies the contents of a database. Transactions access data using read and write operations.In order to maintain consistency in a database, before and after transaction, certain properties are followed. These are called ACID properties. Atomicity By this, we mean that either the entire transaction takes place at once or doesn’t...

filter employees with same salary count greater than five (group by salary) using hibernate criteria? Session session = getCurrentSession(); ProjectionList projectionList = Projections.projectionList(); projectionList.add(Projections.groupProperty("totalCode")) .add(Projections.groupProperty("activityCode")) ...

Friday, 7 December 2018

public class FirstWordUpperCase { public static void main(String[] args) { System.out.println(changeString("how are you man")); } private static String changeString(String str) { StringBuffer sb = new StringBuffer(); String[] arr = str.split("\\s"); for (int i = 0; i < arr.length; i++) { sb.append(Character.toUpperCase(arr[i].charAt(0))). append(arr[i].substring(1)).append(" "); } return sb.toString(); ...

How to disable caching on back button of the browser? <% response.setHeader(“Cache-Control”,”no-store”); response.setHeader(“Pragma”,”no-cache”); response.setHeader (“Expires”, “0”); //prevents caching at the proxy server %> ...

Wednesday, 5 December 2018

In this kind of association, a foreign key column is created in owner entity. For example, if we make EmployeeEntity owner, then a extra column "ACCOUNT_ID" will be created in Employee table. This column will store the foreign key for Account table. To make such association, refer the Account entity in EmployeeEntity class as follow: @OneToOne @JoinColumn(name="ACCOUNT_ID") private...

One table has a foreign key column that references the primary key of associated table.In Bidirectional relationship, both side navigation is possible. We are discussing an example of Student and University relationship. Many student can enroll at one University. And one University can have many students.  @Entity @Table(name =...

In this scenario, any given employee can be assigned to multiple projects and a project may have multiple employees working for it, leading to a many-to-many association between the two. We have an employee table with employee_id as its primary key and a project table with project_id as its primary key. A join table employee_project is...
Page 1 of 101234567...10Next »Last

Search This Blog

Contact us

Name

Email *

Message *