This file contains hidden or 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
| Employee emp1 = new Employee(1,'Ann'); | |
| Employee emp2 = new Employee(2,'John'); | |
| Employee emp3 = new Employee(3,'Rex'); | |
| Map<Employee, String> myHashMap = new HashMap<>(); | |
| hashMap.put(emp1, 'IT'); | |
| hashMap.put(emp2, 'DEV'); | |
| hashMap.put(emp3, 'QA'); | |
| hashMap.put(null, 'QA'); |
This file contains hidden or 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 class Employee{ | |
| private int id; | |
| private String employeeName; | |
| public Employee(int id) { | |
| this.id= id; | |
| } | |
| //getters and setters |
This file contains hidden or 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 React, { useState, useEffect } from 'react' | |
| import Table from '@mui/material/Table'; | |
| import TableBody from '@mui/material/TableBody'; | |
| import TableCell from '@mui/material/TableCell'; | |
| import TableContainer from '@mui/material/TableContainer'; | |
| import TableHead from '@mui/material/TableHead'; | |
| import TableRow from '@mui/material/TableRow'; | |
| import Button from '@mui/material/Button'; | |
| import TextField from '@mui/material/TextField'; | |
| import Dialog from '@mui/material/Dialog'; |
This file contains hidden or 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 React, { useState } from 'react'; | |
| import TaskService from "../service/task.services"; | |
| import { Form, InputGroup, Button } from "react-bootstrap"; | |
| import '../styles/AddTask.css'; | |
| export const AddTask = () => { | |
| const [taskName, setTaskName] = useState(""); | |
| const [taskDescription, setTaskDescription] = useState(""); |
This file contains hidden or 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 { db } from "../firebase-config" | |
| import { doc, getDoc, getDocs, collection, addDoc, updateDoc, deleteDoc} from "firebase/firestore"; | |
| const tasksCollectionRef = collection(db, "tasks"); | |
| class TaskService{ | |
| getTask = (id) => { | |
| const taskDoc = doc(db, "tasks", id); | |
| return getDoc(taskDoc); |
This file contains hidden or 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
| if(instance == null){ | |
| synchronized (ThreadSafe.class){ | |
| if(instance == null){ | |
| instance = new ThreadSafe(); | |
| } | |
| } | |
| } |
This file contains hidden or 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
| synchronized (ThreadSafe.class){ | |
| if(instance == null){ | |
| instance = new ThreadSafe(); | |
| } | |
| } |
This file contains hidden or 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
| @Service | |
| public class EmployeeService { | |
| @Autowired | |
| private AccountService accountService; | |
| @Transactional | |
| public void getAccountDetails() { | |
| accountService.createAccountDocument(); | |
| } |
This file contains hidden or 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
| @Service | |
| @Transactional | |
| public class EmployeeService { | |
| @Autowired | |
| public EmployeeService(EmployeeRepository employeeRepository){ | |
| this.employeeRepository=employeeRepository; | |
| } | |
| private EmployeeRepository employeeRepository; |
This file contains hidden or 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
| @RestController | |
| @RequestMapping("/api/employee") | |
| public class EmployeeController { | |
| @Autowired | |
| public EmployeeController(EmployeeService employeeService){ | |
| this.employeeService=employeeService; | |
| } | |
| private EmployeeService employeeService; |
NewerOlder