This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.swift | |
// Assignment1 | |
// | |
// Created by Hafizur Rahman on 29/7/19. | |
// Copyright © 2019 Hafizur Rahman. All rights reserved. | |
// | |
import Foundation | |
func countPairs (first : [Int], last : [Int], sum: Int ) -> Int { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
@Table(name = AppTables.department) | |
public class Department { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
@Column(name = AppTables.departmentTable.id) | |
private Long id; | |
@Column(name = AppTables.departmentTable.name) | |
private String name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
@Table(name = AppTables.employee) | |
public class Employee { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
@Column(name = AppTables.employeeTable.id) | |
private long id; | |
@Column(name = AppTables.employeeTable.name) | |
private String name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.StackOverflowError: null | |
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_241] | |
at java.lang.ClassLoader.defineClass(Unknown Source) ~[na:1.8.0_241] | |
at java.security.SecureClassLoader.defineClass(Unknown Source) ~[na:1.8.0_241] | |
at java.net.URLClassLoader.defineClass(Unknown Source) ~[na:1.8.0_241] | |
at java.net.URLClassLoader.access$100(Unknown Source) ~[na:1.8.0_241] | |
at java.net.URLClassLoader$1.run(Unknown Source) ~[na:1.8.0_241] | |
at java.net.URLClassLoader$1.run(Unknown Source) ~[na:1.8.0_241] | |
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_241] | |
at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_241] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Department getDepartment() { | |
if (this.department != null) { | |
if (this.department.getDepartmentHead() != null) { | |
this.department.setDepartmentHead(null) | |
} | |
} | |
return department; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
class MyClass { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.println ("Please Enter First Value : "); | |
int a = in.nextInt(); | |
System.out.println ("Please Enter Second Value : "); | |
int b = in.nextInt(); | |
System.out.println ("Please Enter Third Value : "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean deleteCompany (long id) { | |
List<Employee> employees = employeeService.getAllEmployees(); //returns 500+ employees. | |
for (Employee employee : employees) { | |
//lots of business logic. | |
//more than 5 database calls | |
//calculations | |
//logging | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean createPresent (long id) { | |
List<Employee> employees = employeeService.getAllEmployees(); //returns 500+ employees. | |
for (Employee employee : employees) { | |
//lots of business logic. | |
//more than 5 database calls | |
//calculations | |
//logging | |
entityManager.clear(); | |
} |