Skip to content

Instantly share code, notes, and snippets.

View Hafiz-SE's full-sized avatar
🧨
Boom!

Hafizur Rahman Hafiz-SE

🧨
Boom!
View GitHub Profile
@Hafiz-SE
Hafiz-SE / 1.swift
Last active July 29, 2019 18:33
C3_Assignment
//
// 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 {
@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;
@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;
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]
public Department getDepartment() {
if (this.department != null) {
if (this.department.getDepartmentHead() != null) {
this.department.setDepartmentHead(null)
}
}
return department;
}
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 : ");
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
}
}
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();
}