├── .gitattributes ├── .gitignore ├── Day4HW2 ├── Abstract │ ├── BaseCustomerManager.java │ ├── CustomerCheckService.java │ ├── CustomerServices.java │ └── Entity.java ├── Adapter │ └── MernisServiceAdapter.java ├── Concreate │ ├── CustomerCheckManager.java │ ├── NeroCustomerManager.java │ └── StarbucksCustomerManager.java ├── Entities │ └── Customer.java └── InterfaceAbstractDemo │ └── Main.java ├── ETicaretSimulation ├── bin │ ├── Main.class │ ├── business │ │ ├── abstracts │ │ │ ├── AuthService.class │ │ │ ├── EmailService.class │ │ │ └── UserService.class │ │ └── concretes │ │ │ ├── authManager.class │ │ │ ├── emailManager.class │ │ │ └── userManager.class │ ├── core │ │ ├── adapters │ │ │ └── GoogleManager.class │ │ └── utilities │ │ │ └── BusinessRules.class │ ├── dataAccess │ │ ├── abstracts │ │ │ └── UserDao.class │ │ └── concretes │ │ │ └── HibernateUserDao.class │ ├── entities │ │ ├── abstracts │ │ │ └── Entity.class │ │ └── concretes │ │ │ └── User.class │ └── signUpWithGoogle │ │ └── RegisterToGoogle.class └── src │ ├── Main.java │ ├── business │ ├── abstracts │ │ ├── AuthService.java │ │ ├── EmailService.java │ │ └── UserService.java │ └── concretes │ │ ├── authManager.java │ │ ├── emailManager.java │ │ └── userManager.java │ ├── core │ ├── adapters │ │ └── GoogleManager.java │ └── utilities │ │ └── BusinessRules.java │ ├── dataAccess │ ├── abstracts │ │ └── UserDao.java │ └── concretes │ │ └── HibernateUserDao.java │ ├── entities │ ├── abstracts │ │ └── Entity.java │ └── concretes │ │ └── User.java │ └── signUpWithGoogle │ └── RegisterToGoogle.java ├── GameProject ├── Senaryo adresi ├── bin │ ├── Abstract │ │ ├── CampaignService.class │ │ ├── CustomerCheckService.class │ │ ├── CustomerService.class │ │ ├── Entity.class │ │ ├── GameService.class │ │ ├── OrderService.class │ │ ├── SalesService.class │ │ └── UserService.class │ ├── Adapters │ │ └── MernisServiceAdapter.class │ ├── Concrete │ │ ├── CampaignManager.class │ │ ├── CustomerCheckManager.class │ │ ├── CustomerManager.class │ │ ├── GameManager.class │ │ ├── OrderManager.class │ │ ├── SalesManager.class │ │ └── UserManager.class │ ├── Entities │ │ ├── Campaign.class │ │ ├── Customer.class │ │ ├── Game.class │ │ ├── Order.class │ │ └── User.class │ ├── Main │ │ └── Main.class │ └── tr │ │ └── gov │ │ └── nvi │ │ └── tckimlik │ │ └── WS │ │ ├── KPSPublic.class │ │ ├── KPSPublicLocator.class │ │ ├── KPSPublicSoap.class │ │ ├── KPSPublicSoapProxy.class │ │ └── KPSPublicSoapStub.class └── src │ ├── Abstract │ ├── CampaignService.java │ ├── CustomerCheckService.java │ ├── CustomerService.java │ ├── Entity.java │ ├── GameService.java │ ├── OrderService.java │ ├── SalesService.java │ └── UserService.java │ ├── Adapters │ └── MernisServiceAdapter.java │ ├── Concrete │ ├── CampaignManager.java │ ├── CustomerCheckManager.java │ ├── CustomerManager.java │ ├── GameManager.java │ ├── OrderManager.java │ ├── SalesManager.java │ └── UserManager.java │ ├── Entities │ ├── Campaign.java │ ├── Customer.java │ ├── Game.java │ ├── Order.java │ └── User.java │ ├── Main │ └── Main.java │ └── tr │ └── gov │ └── nvi │ └── tckimlik │ └── WS │ ├── KPSPublic.java │ ├── KPSPublicLocator.java │ ├── KPSPublicSoap.java │ ├── KPSPublicSoapProxy.java │ └── KPSPublicSoapStub.java ├── README.md ├── YouTubeUygulamalari └── Day4HW1 │ ├── Abstract Sınıflarla Çalışmak │ ├── GameCalculator.java │ ├── KidsGameCalculator.java │ ├── Main.java │ ├── ManGameCalculator.java │ └── WomanGameCalculator.java │ ├── AbstractDemo │ ├── BaseDatabaseManager.java │ ├── CustomerManager.java │ ├── Main.java │ ├── OracleDatabaseManager.java │ └── SqlServerDatabaseManager.java │ ├── interfaceDemo │ ├── IEatable.java │ ├── IPayable.java │ ├── IWorkable.java │ ├── Main.java │ ├── OutsourceWorker.java │ └── Worker.java │ └── interfaces │ ├── CustomerManager.java │ ├── ICustomerDal.java │ ├── IRepository.java │ ├── Main.java │ ├── MySqlCustomerDal.java │ ├── OlderGameCalculator.java │ └── OracleCustomerDal.java ├── hrms └── hrms │ ├── HELP.md │ ├── easywsdl │ ├── ExKsoap2-1.0.3.1.jar │ └── ksoap2-android-assembly-3.6.4-jar-with-dependencies.jar │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ ├── src │ ├── main │ │ ├── java │ │ │ └── kariyernet │ │ │ │ └── hrms │ │ │ │ ├── HrmsApplication.java │ │ │ │ ├── api │ │ │ │ └── controllers │ │ │ │ │ └── JobPositionsController.java │ │ │ │ ├── business │ │ │ │ ├── abstracts │ │ │ │ │ └── JobPositionService.java │ │ │ │ └── concretes │ │ │ │ │ └── JobPositionManager.java │ │ │ │ ├── dataAccess │ │ │ │ └── abstracts │ │ │ │ │ └── JobPositionDao.java │ │ │ │ └── entities │ │ │ │ └── concretes │ │ │ │ └── JobPosition.java │ │ └── resources │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── kariyernet │ │ └── hrms │ │ └── HrmsApplicationTests.java │ └── target │ ├── classes │ ├── META-INF │ │ ├── MANIFEST.MF │ │ └── maven │ │ │ └── kariyernet │ │ │ └── hrms │ │ │ ├── pom.properties │ │ │ └── pom.xml │ ├── application.properties │ └── kariyernet │ │ └── hrms │ │ ├── HrmsApplication.class │ │ ├── api │ │ └── controllers │ │ │ └── JobPositionsController.class │ │ ├── business │ │ ├── abstracts │ │ │ └── JobPositionService.class │ │ └── concretes │ │ │ └── JobPositionManager.class │ │ ├── dataAccess │ │ └── abstracts │ │ │ └── JobPositionDao.class │ │ └── entities │ │ └── concretes │ │ └── JobPosition.class │ └── test-classes │ └── kariyernet │ └── hrms │ └── HrmsApplicationTests.class ├── javaKampHafta3Odev2 ├── Instructor.java ├── InstructorManager.java ├── Main.java ├── Student.java ├── StudentManager.java ├── User.java └── UserManager.java ├── nLayeredDemo ├── bin │ └── nLayeredDemo │ │ ├── Main.class │ │ ├── business │ │ ├── abstracts │ │ │ └── ProductService.class │ │ └── concretes │ │ │ └── ProductManager.class │ │ ├── core │ │ ├── JLoggerManagerAdaptor.class │ │ └── LoggerService.class │ │ ├── dataAccess │ │ ├── abstracts │ │ │ └── ProductDao.class │ │ └── concretes │ │ │ ├── AbcProductDao.class │ │ │ └── HibernateProductDao.class │ │ ├── entities │ │ ├── abstracts │ │ │ └── Entity.class │ │ └── concretes │ │ │ └── Product.class │ │ └── jLogger │ │ └── JLoggerManager.class └── src │ └── nLayeredDemo │ ├── Main.java │ ├── business │ ├── abstracts │ │ └── ProductService.java │ └── concretes │ │ └── ProductManager.java │ ├── core │ ├── JLoggerManagerAdaptor.java │ └── LoggerService.java │ ├── dataAccess │ ├── abstracts │ │ └── ProductDao.java │ └── concretes │ │ ├── AbcProductDao.java │ │ └── HibernateProductDao.java │ ├── entities │ ├── abstracts │ │ └── Entity.java │ └── concretes │ │ └── Product.java │ └── jLogger │ └── JLoggerManager.java └── northwind ├── mvnw ├── mvnw.cmd ├── pom.xml ├── src ├── main │ ├── java │ │ └── kodlamaio │ │ │ └── northwind │ │ │ ├── NorthwindApplication.java │ │ │ ├── api │ │ │ └── controllers │ │ │ │ └── ProductsController.java │ │ │ ├── business │ │ │ ├── abstracts │ │ │ │ └── ProductService.java │ │ │ └── concretes │ │ │ │ └── ProductManager.java │ │ │ ├── core │ │ │ └── utilities │ │ │ │ └── results │ │ │ │ ├── DataResult.java │ │ │ │ ├── ErrorDataResult.java │ │ │ │ ├── ErrorResult.java │ │ │ │ ├── Result.java │ │ │ │ ├── SuccessDataResult.java │ │ │ │ └── successResult.java │ │ │ ├── dataAccess │ │ │ └── abstracts │ │ │ │ └── ProductDao.java │ │ │ └── entities │ │ │ └── concretes │ │ │ ├── Category.java │ │ │ └── Product.java │ └── resources │ │ └── application.properties └── test │ └── java │ └── kodlamaio │ └── northwind │ └── NorthwindApplicationTests.java └── target ├── classes ├── META-INF │ ├── MANIFEST.MF │ └── maven │ │ └── kodlamaio │ │ └── northwind │ │ ├── pom.properties │ │ └── pom.xml ├── application.properties └── kodlamaio │ └── northwind │ ├── NorthwindApplication.class │ ├── api │ └── controllers │ │ └── ProductsController.class │ ├── business │ ├── abstracts │ │ └── ProductService.class │ └── concretes │ │ └── ProductManager.class │ ├── core │ └── utilities │ │ └── results │ │ ├── DataResult.class │ │ ├── ErrorDataResult.class │ │ ├── ErrorResult.class │ │ ├── Result.class │ │ ├── SuccessDataResult.class │ │ └── successResult.class │ ├── dataAccess │ └── abstracts │ │ └── ProductDao.class │ └── entities │ └── concretes │ ├── Category.class │ └── Product.class └── test-classes └── kodlamaio └── northwind └── NorthwindApplicationTests.class /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | -------------------------------------------------------------------------------- /Day4HW2/Abstract/BaseCustomerManager.java: -------------------------------------------------------------------------------- 1 | public abstract class BaseCustomerManager implements CustomerService { 2 | @Override 3 | public void save(Customer customer) { 4 | 5 | System.out.println("saved to db: " + customer.getFirstName()); 6 | 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Day4HW2/Abstract/CustomerCheckService.java: -------------------------------------------------------------------------------- 1 | public interface CustomerCheckService { 2 | 3 | 4 | 5 | boolean checkIfRealPerson(Customer customer); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Day4HW2/Abstract/CustomerServices.java: -------------------------------------------------------------------------------- 1 | public interface CustomerService { 2 | void save(Customer customer); 3 | } 4 | -------------------------------------------------------------------------------- /Day4HW2/Abstract/Entity.java: -------------------------------------------------------------------------------- 1 | public interface Entity { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /Day4HW2/Adapter/MernisServiceAdapter.java: -------------------------------------------------------------------------------- 1 | import java.rmi.RemoteException; 2 | 3 | import Abstract.CustomerCheckService; 4 | import Entities.Customer; 5 | import tr.gov.nvi.tckimlik.WS.*; 6 | 7 | public class MernisServiceAdapter implements CustomerCheckService { 8 | @Override 9 | public boolean checkIfRealPerson(Customer customer) { 10 | KPSPublicSoap client = new KPSPublicSoapProxy(); 11 | boolean result = false; 12 | 13 | try { 14 | result = client.TCKimlikNoDogrula(Long.parseLong(customer.getNationalityId()),customer.getFirstName().toUpperCase(),customer.getLastName().toUpperCase(),customer.getBirthOfYear()); 15 | } 16 | catch (NumberFormatException e) { 17 | e.printStackTrace(); 18 | } 19 | catch (RemoteException e) { 20 | e.printStackTrace(); 21 | } 22 | return result; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Day4HW2/Concreate/CustomerCheckManager.java: -------------------------------------------------------------------------------- 1 | public class CustomerCheckManager implements CustomerCheckService { 2 | @Override 3 | public boolean checkIfRealPerson(Customer customer) { 4 | return true; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Day4HW2/Concreate/NeroCustomerManager.java: -------------------------------------------------------------------------------- 1 | public class NeroCustomerManager extends BaseCustomerManager { 2 | @Override 3 | public void save(Customer customer) { 4 | 5 | super.save(customer); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Day4HW2/Concreate/StarbucksCustomerManager.java: -------------------------------------------------------------------------------- 1 | public class StarbucksCustomerManager extends BaseCustomerManager { 2 | private CustomerCheckService customerCheckService; 3 | 4 | 5 | public StarbucksCustomerManager(CustomerCheckService customerCheckService) { 6 | this.customerCheckService = customerCheckService; 7 | } 8 | 9 | 10 | @Override 11 | public void save(Customer customer) { 12 | 13 | if (this.customerCheckService.checkIfRealPerson(customer)) { 14 | super.save(customer); 15 | } 16 | else 17 | { 18 | System.out.println("Not a valid person."); 19 | } 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Day4HW2/Entities/Customer.java: -------------------------------------------------------------------------------- 1 | 2 | import java.sql.Date; 3 | import java.text.SimpleDateFormat; 4 | import java.time.LocalDate; 5 | 6 | 7 | public class Customer { 8 | int id; 9 | String firstName; 10 | String lastName; 11 | Date dateOfBirth; 12 | String nationalityId; 13 | public Customer(){ 14 | } 15 | public Customer(int id, String firstName, String lastName, int i) { 16 | this.id = id; 17 | this.firstName = firstName; 18 | this.lastName = lastName; 19 | this.dateOfBirth=dateOfBirth; 20 | this.nationalityId = nationalityId; 21 | } 22 | 23 | public int getId() { 24 | return id; 25 | } 26 | public void setId(int id) { 27 | this.id = id; 28 | } 29 | public String getFirstName() { 30 | return firstName; 31 | } 32 | public void setFirstName(String firstName) { 33 | this.firstName = firstName; 34 | } 35 | public String getLastName() { 36 | return lastName; 37 | } 38 | public void setLastName(String lastName) { 39 | this.lastName = lastName; 40 | } 41 | public Date getDateOfBirth() { 42 | return dateOfBirth; 43 | } 44 | public void setDateOfBirth(Date dateOfBirth) { 45 | this.dateOfBirth = dateOfBirth; 46 | } 47 | public String getNationalityId() { 48 | return nationalityId; 49 | } 50 | public void setNationalityId(String nationalityId) { 51 | this.nationalityId = nationalityId; 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /Day4HW2/InterfaceAbstractDemo/Main.java: -------------------------------------------------------------------------------- 1 | import java.sql.Date; 2 | 3 | import java.sql.Date; 4 | 5 | import java.time.LocalDate; 6 | 7 | public class Main{ 8 | public static void main(String[] args) { 9 | Customer customer = new Customer(); 10 | customer.setId(1); 11 | customer.setFirstName("Melik"); 12 | customer.setLastName("KARACA"); 13 | customer.setDateOfBirth(1994,3,17); 14 | customer.setNationalityId("458721"); 15 | 16 | BaseCustomerManager customerManager = new NeroCustomerManager(new MernisServiceAdapter()); 17 | customerManager.save(customer); 18 | } 19 | } -------------------------------------------------------------------------------- /ETicaretSimulation/bin/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/Main.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/business/abstracts/AuthService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/business/abstracts/AuthService.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/business/abstracts/EmailService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/business/abstracts/EmailService.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/business/abstracts/UserService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/business/abstracts/UserService.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/business/concretes/authManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/business/concretes/authManager.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/business/concretes/emailManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/business/concretes/emailManager.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/business/concretes/userManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/business/concretes/userManager.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/core/adapters/GoogleManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/core/adapters/GoogleManager.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/core/utilities/BusinessRules.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/core/utilities/BusinessRules.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/dataAccess/abstracts/UserDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/dataAccess/abstracts/UserDao.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/dataAccess/concretes/HibernateUserDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/dataAccess/concretes/HibernateUserDao.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/entities/abstracts/Entity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/entities/abstracts/Entity.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/entities/concretes/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/entities/concretes/User.class -------------------------------------------------------------------------------- /ETicaretSimulation/bin/signUpWithGoogle/RegisterToGoogle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/bin/signUpWithGoogle/RegisterToGoogle.class -------------------------------------------------------------------------------- /ETicaretSimulation/src/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | import business.abstracts.UserService; 4 | import business.concretes.authManager; 5 | import business.concretes.emailManager; 6 | import business.concretes.userManager; 7 | import dataAccess.concretes.HibernateUserDao; 8 | import entities.concretes.User; 9 | 10 | public class Main { 11 | @SuppressWarnings("kaynak") 12 | public static void main(String[] args) { 13 | Scanner scan = new Scanner(System.in); 14 | User user = new User(); 15 | user.setId(1); 16 | user.setFirstName("Melik"); 17 | user.setLastName("KARACA"); 18 | user.seteMail("melikkrc25@gmail.com"); 19 | user.setPassword("deneme123"); 20 | 21 | UserService userService=new userManager(new HibernateUserDao(),new authManager(),new emailManager()); 22 | userService.getAll(); 23 | userService.add(user); 24 | 25 | int verificationCode=scan.nextInt(); 26 | userService.userVerify(user, verificationCode); 27 | 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /ETicaretSimulation/src/business/abstracts/AuthService.java: -------------------------------------------------------------------------------- 1 | package business.abstracts; 2 | 3 | import entities.concretes.User; 4 | 5 | public interface AuthService { 6 | boolean validate(User user); 7 | boolean login(User user); 8 | } 9 | -------------------------------------------------------------------------------- /ETicaretSimulation/src/business/abstracts/EmailService.java: -------------------------------------------------------------------------------- 1 | package business.abstracts; 2 | 3 | public interface EmailService { 4 | int mailSend(); 5 | } 6 | -------------------------------------------------------------------------------- /ETicaretSimulation/src/business/abstracts/UserService.java: -------------------------------------------------------------------------------- 1 | package business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import entities.concretes.User; 6 | 7 | public interface UserService { 8 | void add(User user); 9 | void delete(User user); 10 | void update(User user); 11 | User get(int id); 12 | List getAll(); 13 | void userVerify(User user,int verificationCode); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ETicaretSimulation/src/business/concretes/authManager.java: -------------------------------------------------------------------------------- 1 | package business.concretes; 2 | 3 | import java.util.regex.Pattern; 4 | 5 | import business.abstracts.UserService; 6 | import business.abstracts.AuthService; 7 | import core.utilities.BusinessRules; 8 | import entities.concretes.User; 9 | 10 | public class authManager implements AuthService { 11 | public static final Pattern VALID_EMAIL_ADDRESS_REGEX= 12 | Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$",Pattern.CASE_INSENSITIVE); 13 | @Override 14 | public boolean validate(User user) { 15 | boolean sonuc=BusinessRules.Run(ifPasswordCheckLength(user), 16 | ifFirstNameCheckLength(user), 17 | ifLastNameCheckLength(user), 18 | ifEmailFormatCheckValid(user)); 19 | return sonuc; 20 | } 21 | private boolean ifPasswordCheckLength(User user) { 22 | if(user.getPassword().length()<6) { 23 | System.out.println("Parola en az 6 karakter olmali"); 24 | return false; 25 | } 26 | return true; 27 | } 28 | private boolean ifFirstNameCheckLength(User user) { 29 | if(user.getFirstName().length()<2) { 30 | System.out.println("isminiz en az 2 karakterli olmali. "); 31 | return false; 32 | } 33 | return true; 34 | } 35 | private boolean ifLastNameCheckLength(User user) { 36 | if(user.getLastName().length()<2) { 37 | System.out.println("Soyadiniz en az 2 karakterli olmali. "); 38 | return false; 39 | } 40 | return true; 41 | } 42 | private boolean ifEmailFormatCheckValid(User email) { 43 | return VALID_EMAIL_ADDRESS_REGEX.matcher(email.geteMail()).find(); 44 | } 45 | 46 | @Override 47 | public boolean login(User user) { 48 | boolean sonuc= BusinessRules.Run(isFirstandLastNameEmpty(user)); 49 | return sonuc; 50 | } 51 | private boolean isFirstandLastNameEmpty(User user) { 52 | if(user.geteMail()==null||user.getPassword()==null) { 53 | System.out.println("email veya password eksik girildi."); 54 | return false; 55 | } 56 | System.out.println("giris yapildi."); 57 | return true; 58 | } 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /ETicaretSimulation/src/business/concretes/emailManager.java: -------------------------------------------------------------------------------- 1 | package business.concretes; 2 | 3 | import java.util.Random; 4 | 5 | import business.abstracts.EmailService; 6 | 7 | public class emailManager implements EmailService{ 8 | int verificationCode; 9 | public emailManager() { 10 | Random kod=new Random(); 11 | this.verificationCode=kod.nextInt(1000)*10; 12 | } 13 | @Override 14 | public int mailSend() { 15 | 16 | return 0; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /ETicaretSimulation/src/business/concretes/userManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/src/business/concretes/userManager.java -------------------------------------------------------------------------------- /ETicaretSimulation/src/core/adapters/GoogleManager.java: -------------------------------------------------------------------------------- 1 | package core.adapters; 2 | 3 | import business.abstracts.AuthService; 4 | import signUpWithGoogle.RegisterToGoogle; 5 | import core.utilities.BusinessRules; 6 | import entities.concretes.User; 7 | 8 | public class GoogleManager implements AuthService { 9 | RegisterToGoogle registerToGoogle=new RegisterToGoogle(); 10 | 11 | @Override 12 | public boolean validate(User user) { 13 | boolean sonuc= false; 14 | sonuc=registerToGoogle.register(user.getId(),user.getFirstName(),user.getLastName(),user.geteMail(), 15 | user.getPassword()); 16 | if(sonuc!=true) { 17 | return false; 18 | } 19 | System.out.println("Kayit olundu."); 20 | return true; 21 | } 22 | 23 | @Override 24 | public boolean login(User user) { 25 | boolean sonuc=BusinessRules.Run(isFirstandLastNameEmpty(user)); 26 | 27 | return sonuc; 28 | } 29 | private boolean isFirstandLastNameEmpty(User user) { 30 | if(user.geteMail()==null||user.getPassword()==null) { 31 | System.out.println("email veya password eksik girildi."); 32 | return false; 33 | } 34 | System.out.println("giris yapildi."); 35 | return true; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /ETicaretSimulation/src/core/utilities/BusinessRules.java: -------------------------------------------------------------------------------- 1 | package core.utilities; 2 | 3 | public class BusinessRules { 4 | public static boolean Run(boolean... logics) { 5 | for(boolean logic : logics) { 6 | if(!logic) { 7 | return false; 8 | } 9 | } 10 | return true; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ETicaretSimulation/src/dataAccess/abstracts/UserDao.java: -------------------------------------------------------------------------------- 1 | package dataAccess.abstracts; 2 | 3 | 4 | import java.util.List; 5 | 6 | import entities.concretes.User; 7 | 8 | public interface UserDao { 9 | void add(User user); 10 | void delete(User user); 11 | void update(User user); 12 | User get(int id); 13 | List getAll(); 14 | User getEmail(String mail); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ETicaretSimulation/src/dataAccess/concretes/HibernateUserDao.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/ETicaretSimulation/src/dataAccess/concretes/HibernateUserDao.java -------------------------------------------------------------------------------- /ETicaretSimulation/src/entities/abstracts/Entity.java: -------------------------------------------------------------------------------- 1 | package entities.abstracts; 2 | 3 | public interface Entity { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /ETicaretSimulation/src/entities/concretes/User.java: -------------------------------------------------------------------------------- 1 | package entities.concretes; 2 | 3 | import entities.abstracts.Entity; 4 | 5 | public class User implements Entity { 6 | private int id; 7 | private String firstName; 8 | private String lastName; 9 | private String eMail; 10 | private String password; 11 | 12 | public User() { 13 | 14 | } 15 | 16 | public User(int id, String firstName, String lastName, String eMail, String password) { 17 | super(); 18 | this.id = id; 19 | this.firstName = firstName; 20 | this.lastName = lastName; 21 | this.eMail = eMail; 22 | this.password = password; 23 | } 24 | 25 | public int getId() { 26 | return id; 27 | } 28 | 29 | public void setId(int id) { 30 | this.id = id; 31 | } 32 | 33 | public String getFirstName() { 34 | return firstName; 35 | } 36 | 37 | public void setFirstName(String firstName) { 38 | this.firstName = firstName; 39 | } 40 | 41 | public String getLastName() { 42 | return lastName; 43 | } 44 | 45 | public void setLastName(String lastName) { 46 | this.lastName = lastName; 47 | } 48 | 49 | public String geteMail() { 50 | return eMail; 51 | } 52 | 53 | public void seteMail(String eMail) { 54 | this.eMail = eMail; 55 | } 56 | 57 | public String getPassword() { 58 | return password; 59 | } 60 | 61 | public void setPassword(String password) { 62 | this.password = password; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ETicaretSimulation/src/signUpWithGoogle/RegisterToGoogle.java: -------------------------------------------------------------------------------- 1 | package signUpWithGoogle; 2 | 3 | public class RegisterToGoogle { 4 | public boolean register(int id,String firstName,String LastName,String email,String password) { 5 | if(firstName.length()>6&&LastName.length()>6&&email.length()>6&&password.length()>6) { 6 | return true; 7 | } 8 | return false; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /GameProject/Senaryo adresi: -------------------------------------------------------------------------------- 1 | Engin DEMİROG Yazılım Geliştirici Yetiştirme Kampı (JAVA + REACT) 2 | 3 | Senaryoyu adresten bakabilirsiniz. 4 | https://www.kodlama.io/courses/1332369/lectures/32126106 5 | -------------------------------------------------------------------------------- /GameProject/bin/Abstract/CampaignService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Abstract/CampaignService.class -------------------------------------------------------------------------------- /GameProject/bin/Abstract/CustomerCheckService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Abstract/CustomerCheckService.class -------------------------------------------------------------------------------- /GameProject/bin/Abstract/CustomerService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Abstract/CustomerService.class -------------------------------------------------------------------------------- /GameProject/bin/Abstract/Entity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Abstract/Entity.class -------------------------------------------------------------------------------- /GameProject/bin/Abstract/GameService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Abstract/GameService.class -------------------------------------------------------------------------------- /GameProject/bin/Abstract/OrderService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Abstract/OrderService.class -------------------------------------------------------------------------------- /GameProject/bin/Abstract/SalesService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Abstract/SalesService.class -------------------------------------------------------------------------------- /GameProject/bin/Abstract/UserService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Abstract/UserService.class -------------------------------------------------------------------------------- /GameProject/bin/Adapters/MernisServiceAdapter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Adapters/MernisServiceAdapter.class -------------------------------------------------------------------------------- /GameProject/bin/Concrete/CampaignManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Concrete/CampaignManager.class -------------------------------------------------------------------------------- /GameProject/bin/Concrete/CustomerCheckManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Concrete/CustomerCheckManager.class -------------------------------------------------------------------------------- /GameProject/bin/Concrete/CustomerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Concrete/CustomerManager.class -------------------------------------------------------------------------------- /GameProject/bin/Concrete/GameManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Concrete/GameManager.class -------------------------------------------------------------------------------- /GameProject/bin/Concrete/OrderManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Concrete/OrderManager.class -------------------------------------------------------------------------------- /GameProject/bin/Concrete/SalesManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Concrete/SalesManager.class -------------------------------------------------------------------------------- /GameProject/bin/Concrete/UserManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Concrete/UserManager.class -------------------------------------------------------------------------------- /GameProject/bin/Entities/Campaign.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Entities/Campaign.class -------------------------------------------------------------------------------- /GameProject/bin/Entities/Customer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Entities/Customer.class -------------------------------------------------------------------------------- /GameProject/bin/Entities/Game.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Entities/Game.class -------------------------------------------------------------------------------- /GameProject/bin/Entities/Order.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Entities/Order.class -------------------------------------------------------------------------------- /GameProject/bin/Entities/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Entities/User.class -------------------------------------------------------------------------------- /GameProject/bin/Main/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/Main/Main.class -------------------------------------------------------------------------------- /GameProject/bin/tr/gov/nvi/tckimlik/WS/KPSPublic.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/tr/gov/nvi/tckimlik/WS/KPSPublic.class -------------------------------------------------------------------------------- /GameProject/bin/tr/gov/nvi/tckimlik/WS/KPSPublicLocator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/tr/gov/nvi/tckimlik/WS/KPSPublicLocator.class -------------------------------------------------------------------------------- /GameProject/bin/tr/gov/nvi/tckimlik/WS/KPSPublicSoap.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/tr/gov/nvi/tckimlik/WS/KPSPublicSoap.class -------------------------------------------------------------------------------- /GameProject/bin/tr/gov/nvi/tckimlik/WS/KPSPublicSoapProxy.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/tr/gov/nvi/tckimlik/WS/KPSPublicSoapProxy.class -------------------------------------------------------------------------------- /GameProject/bin/tr/gov/nvi/tckimlik/WS/KPSPublicSoapStub.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/bin/tr/gov/nvi/tckimlik/WS/KPSPublicSoapStub.class -------------------------------------------------------------------------------- /GameProject/src/Abstract/CampaignService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | import Entities.Campaign; 4 | 5 | public interface CampaignService { 6 | public void add(Campaign campaign); 7 | 8 | public void update(Campaign campaign); 9 | 10 | public void delete(Campaign campaign); 11 | } 12 | -------------------------------------------------------------------------------- /GameProject/src/Abstract/CustomerCheckService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | import Entities.Customer; 4 | 5 | public interface CustomerCheckService { 6 | public boolean checkIfRealPerson(Customer customer); 7 | } 8 | -------------------------------------------------------------------------------- /GameProject/src/Abstract/CustomerService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | import Entities.Customer; 4 | 5 | public interface CustomerService { 6 | public void add(Customer customer); 7 | 8 | public void update(Customer customer); 9 | 10 | public void delete(Customer customer); 11 | } 12 | -------------------------------------------------------------------------------- /GameProject/src/Abstract/Entity.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | public interface Entity { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /GameProject/src/Abstract/GameService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | 3 | import Entities.Game; 4 | 5 | public interface GameService { 6 | public void add(Game game); 7 | 8 | public void update(Game game); 9 | 10 | public void delete(Game game); 11 | } 12 | -------------------------------------------------------------------------------- /GameProject/src/Abstract/OrderService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | import Entities.Order; 3 | public interface OrderService { 4 | public void add(Order order); 5 | 6 | public void update(Order order); 7 | 8 | public void delete(Order order); 9 | } 10 | -------------------------------------------------------------------------------- /GameProject/src/Abstract/SalesService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | import Entities.Campaign; 3 | import Entities.Customer; 4 | import Entities.Game; 5 | import Entities.Order; 6 | 7 | public interface SalesService { 8 | public void buy(Order order, Customer customer, Game[] games, Campaign campaign); 9 | } 10 | -------------------------------------------------------------------------------- /GameProject/src/Abstract/UserService.java: -------------------------------------------------------------------------------- 1 | package Abstract; 2 | import Entities.User; 3 | public interface UserService { 4 | public void add(User user); 5 | 6 | public void update(User user); 7 | 8 | public void delete(User user); 9 | } 10 | -------------------------------------------------------------------------------- /GameProject/src/Adapters/MernisServiceAdapter.java: -------------------------------------------------------------------------------- 1 | package Adapters; 2 | import java.rmi.RemoteException; 3 | 4 | 5 | import Abstract.CustomerCheckService; 6 | import Entities.Customer; 7 | import tr.gov.nvi.tckimlik.WS.KPSPublicSoap; 8 | import tr.gov.nvi.tckimlik.WS.KPSPublicSoapProxy; 9 | public class MernisServiceAdapter implements CustomerCheckService { 10 | @Override 11 | public boolean checkIfRealPerson(Customer customer) { 12 | KPSPublicSoap soapClient = new KPSPublicSoapProxy(); 13 | 14 | boolean result = false; 15 | try { 16 | result = soapClient.TCKimlikNoDogrula( 17 | Long.parseLong(customer.getNationalityId()), 18 | customer.getFirstName().toUpperCase(), 19 | customer.getLastName().toUpperCase(), 20 | customer.getDateOfBirthYear()); 21 | } catch (NumberFormatException e) { 22 | e.printStackTrace(); 23 | } catch (RemoteException e) { 24 | e.printStackTrace(); 25 | } 26 | return result; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /GameProject/src/Concrete/CampaignManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/src/Concrete/CampaignManager.java -------------------------------------------------------------------------------- /GameProject/src/Concrete/CustomerCheckManager.java: -------------------------------------------------------------------------------- 1 | package Concrete; 2 | 3 | import Entities.Customer; 4 | import Abstract.CustomerCheckService; 5 | 6 | public class CustomerCheckManager implements CustomerCheckService { 7 | 8 | @Override 9 | public boolean checkIfRealPerson(Customer customer) { 10 | 11 | return true; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /GameProject/src/Concrete/CustomerManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/src/Concrete/CustomerManager.java -------------------------------------------------------------------------------- /GameProject/src/Concrete/GameManager.java: -------------------------------------------------------------------------------- 1 | package Concrete; 2 | 3 | import Abstract.GameService; 4 | 5 | import Entities.Game; 6 | 7 | public class GameManager implements GameService { 8 | 9 | @Override 10 | public void add(Game game) { 11 | System.out.println(game.getName() + " Oyun eklendi."); 12 | 13 | } 14 | 15 | @Override 16 | public void update(Game game) { 17 | System.out.println(game.getName() + " Oyun guncellendi."); 18 | 19 | } 20 | 21 | @Override 22 | public void delete(Game game) { 23 | System.out.println(game.getName() + " Oyun silindi."); 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /GameProject/src/Concrete/OrderManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/src/Concrete/OrderManager.java -------------------------------------------------------------------------------- /GameProject/src/Concrete/SalesManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/src/Concrete/SalesManager.java -------------------------------------------------------------------------------- /GameProject/src/Concrete/UserManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/GameProject/src/Concrete/UserManager.java -------------------------------------------------------------------------------- /GameProject/src/Entities/Campaign.java: -------------------------------------------------------------------------------- 1 | package Entities; 2 | 3 | import Abstract.Entity; 4 | 5 | public class Campaign implements Entity { 6 | private int id; 7 | private String name; 8 | private int discount; 9 | private boolean status; 10 | 11 | public Campaign(int id, String name, int discount, boolean status) { 12 | this.id = id; 13 | this.name = name; 14 | this.discount = discount; 15 | this.status = status; 16 | } 17 | 18 | public int getId() { 19 | return id; 20 | } 21 | 22 | public void setId(int id) { 23 | this.id = id; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public void setName(String name) { 31 | this.name = name; 32 | } 33 | 34 | public int getDiscount() { 35 | return discount; 36 | } 37 | 38 | public void setDiscount(int discount) { 39 | this.discount = discount; 40 | } 41 | 42 | public boolean isStatus() { 43 | return status; 44 | } 45 | 46 | public void setStatus(boolean status) { 47 | this.status = status; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /GameProject/src/Entities/Customer.java: -------------------------------------------------------------------------------- 1 | package Entities; 2 | import Abstract.Entity; 3 | public class Customer implements Entity { 4 | private int id; 5 | private String firstName; 6 | private String lastName; 7 | private String nationalityId; 8 | private int dateOfBirthYear; 9 | 10 | public Customer() { 11 | 12 | } 13 | 14 | public Customer(int id, String firstName, String lastName, String nationalityId, int dateOfBirthYear) { 15 | this.id = id; 16 | this.firstName = firstName; 17 | this.lastName = lastName; 18 | this.nationalityId = nationalityId; 19 | this.dateOfBirthYear = dateOfBirthYear; 20 | } 21 | 22 | public int getId() { 23 | return id; 24 | } 25 | 26 | public void setId(int id) { 27 | this.id = id; 28 | } 29 | 30 | public String getFirstName() { 31 | return firstName; 32 | } 33 | 34 | public void setFirstName(String firstName) { 35 | this.firstName = firstName; 36 | } 37 | 38 | public String getLastName() { 39 | return lastName; 40 | } 41 | 42 | public void setLastName(String lastName) { 43 | this.lastName = lastName; 44 | } 45 | 46 | public String getNationalityId() { 47 | return nationalityId; 48 | } 49 | 50 | public void setNationalityId(String nationalityId) { 51 | this.nationalityId = nationalityId; 52 | } 53 | 54 | public int getDateOfBirthYear() { 55 | return dateOfBirthYear; 56 | } 57 | 58 | public void setDateOfBirthYear(int dateOfBirthYear) { 59 | this.dateOfBirthYear = dateOfBirthYear; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /GameProject/src/Entities/Game.java: -------------------------------------------------------------------------------- 1 | package Entities; 2 | import Abstract.Entity; 3 | 4 | public class Game implements Entity { 5 | private int id; 6 | private String name; 7 | private Double price; 8 | 9 | public Game(int id, String name, Double price) { 10 | this.id = id; 11 | this.name = name; 12 | this.price = price; 13 | } 14 | 15 | public int getId() { 16 | return id; 17 | } 18 | 19 | public void setId(int id) { 20 | this.id = id; 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | public Double getPrice() { 32 | return price; 33 | } 34 | 35 | public void setPrice(Double price) { 36 | this.price = price; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /GameProject/src/Entities/Order.java: -------------------------------------------------------------------------------- 1 | package Entities; 2 | 3 | import java.time.LocalDate; 4 | 5 | import Abstract.Entity; 6 | 7 | public class Order implements Entity { 8 | private int id; 9 | private int customerId; 10 | private int gameId; 11 | private int campaignId; 12 | private LocalDate date; 13 | 14 | public Order(int id, int customerId, int gameId, LocalDate date) { 15 | this.id = id; 16 | this.customerId = customerId; 17 | this.gameId = gameId; 18 | this.date = date; 19 | } 20 | 21 | public Order(int id, int customerId, int gameId, int campaignId, LocalDate date) { 22 | this.id = id; 23 | this.customerId = customerId; 24 | this.gameId = gameId; 25 | this.campaignId = campaignId; 26 | this.date = date; 27 | } 28 | 29 | public int getId() { 30 | return id; 31 | } 32 | 33 | public void setId(int id) { 34 | this.id = id; 35 | } 36 | 37 | public int getCustomerId() { 38 | return customerId; 39 | } 40 | 41 | public void setCustomerId(int customerId) { 42 | this.customerId = customerId; 43 | } 44 | 45 | public int getGameId() { 46 | return gameId; 47 | } 48 | 49 | public void setGameId(int gameId) { 50 | this.gameId = gameId; 51 | } 52 | 53 | public int getCampaignId() { 54 | return campaignId; 55 | } 56 | 57 | public void setCampaignId(int campaignId) { 58 | this.campaignId = campaignId; 59 | } 60 | 61 | public LocalDate getDate() { 62 | return date; 63 | } 64 | 65 | public void setDate(LocalDate date) { 66 | this.date = date; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /GameProject/src/Entities/User.java: -------------------------------------------------------------------------------- 1 | package Entities; 2 | 3 | import Abstract.Entity; 4 | 5 | public class User implements Entity { 6 | private int id; 7 | private int customerId; 8 | private String email; 9 | private String password; 10 | 11 | public User(int id, int customerId, String email, String password) { 12 | this.id = id; 13 | this.customerId = customerId; 14 | this.email = email; 15 | this.password = password; 16 | } 17 | 18 | public int getId() { 19 | return id; 20 | } 21 | 22 | public void setId(int id) { 23 | this.id = id; 24 | } 25 | 26 | public int getCustomerId() { 27 | return customerId; 28 | } 29 | 30 | public void setCustomerId(int customerId) { 31 | this.customerId = customerId; 32 | } 33 | 34 | public String getEmail() { 35 | return email; 36 | } 37 | 38 | public void setEmail(String email) { 39 | this.email = email; 40 | } 41 | 42 | public String getPassword() { 43 | return password; 44 | } 45 | 46 | public void setPassword(String password) { 47 | this.password = password; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /GameProject/src/Main/Main.java: -------------------------------------------------------------------------------- 1 | package Main; 2 | 3 | import java.time.LocalDate; 4 | 5 | import Adapters.MernisServiceAdapter; 6 | import Concrete.CampaignManager; 7 | import Concrete.CustomerManager; 8 | import Concrete.GameManager; 9 | import Concrete.OrderManager; 10 | import Concrete.SalesManager; 11 | import Entities.Campaign; 12 | import Entities.Customer; 13 | import Entities.Game; 14 | import Entities.Order; 15 | public class Main { 16 | 17 | public static void main(String[] args) { 18 | 19 | CustomerManager customerManager = new CustomerManager(new MernisServiceAdapter()); 20 | CampaignManager campaignManager = new CampaignManager(); 21 | OrderManager orderManager = new OrderManager(); 22 | SalesManager salesManager = new SalesManager(orderManager); 23 | GameManager gameManager = new GameManager(); 24 | 25 | //Musteri olusturuldu Mernis Kisi bilgileri dogru girildiginde calisiyor. 26 | Customer customer = new Customer(1, "Melik", "KARACA", "123456", 1994); 27 | customerManager.add(customer); 28 | 29 | //1.oyun olusturuldu 30 | Game theLastOfUs2Game = new Game(1, "The Last Of Us 2", 25.0); 31 | gameManager.add(theLastOfUs2Game); 32 | 33 | //2.oyun olusturuldu 34 | Game hitman3Game = new Game(2, "Hitman 3", 35.0); 35 | gameManager.add(hitman3Game); 36 | 37 | //Kampanya olusturuldu 38 | Campaign blackFridayCampaign = new Campaign(1, "Black Friday", 30, true); 39 | campaignManager.add(blackFridayCampaign); 40 | 41 | //Siparis olusturuldu 42 | Order order = new Order(1, 1, 1, 1, LocalDate.now()); 43 | 44 | 45 | Game[] games = new Game[] { theLastOfUs2Game, hitman3Game }; 46 | 47 | System.out.println("Kampanyali Senaryo"); 48 | salesManager.buy(order, customer, games, blackFridayCampaign); 49 | 50 | System.out.println("Kampanyasiz Senaryo"); 51 | salesManager.buy(order, customer, games, null); 52 | 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /GameProject/src/tr/gov/nvi/tckimlik/WS/KPSPublic.java: -------------------------------------------------------------------------------- 1 | /** 2 | * KPSPublic.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package tr.gov.nvi.tckimlik.WS; 9 | 10 | public interface KPSPublic extends javax.xml.rpc.Service { 11 | public java.lang.String getKPSPublicSoapAddress(); 12 | 13 | public tr.gov.nvi.tckimlik.WS.KPSPublicSoap getKPSPublicSoap() throws javax.xml.rpc.ServiceException; 14 | 15 | public tr.gov.nvi.tckimlik.WS.KPSPublicSoap getKPSPublicSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; 16 | } 17 | -------------------------------------------------------------------------------- /GameProject/src/tr/gov/nvi/tckimlik/WS/KPSPublicLocator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * KPSPublicLocator.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package tr.gov.nvi.tckimlik.WS; 9 | 10 | public class KPSPublicLocator extends org.apache.axis.client.Service implements tr.gov.nvi.tckimlik.WS.KPSPublic { 11 | 12 | public KPSPublicLocator() { 13 | } 14 | 15 | 16 | public KPSPublicLocator(org.apache.axis.EngineConfiguration config) { 17 | super(config); 18 | } 19 | 20 | public KPSPublicLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { 21 | super(wsdlLoc, sName); 22 | } 23 | 24 | // Use to get a proxy class for KPSPublicSoap 25 | private java.lang.String KPSPublicSoap_address = "https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx"; 26 | 27 | public java.lang.String getKPSPublicSoapAddress() { 28 | return KPSPublicSoap_address; 29 | } 30 | 31 | // The WSDD service name defaults to the port name. 32 | private java.lang.String KPSPublicSoapWSDDServiceName = "KPSPublicSoap"; 33 | 34 | public java.lang.String getKPSPublicSoapWSDDServiceName() { 35 | return KPSPublicSoapWSDDServiceName; 36 | } 37 | 38 | public void setKPSPublicSoapWSDDServiceName(java.lang.String name) { 39 | KPSPublicSoapWSDDServiceName = name; 40 | } 41 | 42 | public tr.gov.nvi.tckimlik.WS.KPSPublicSoap getKPSPublicSoap() throws javax.xml.rpc.ServiceException { 43 | java.net.URL endpoint; 44 | try { 45 | endpoint = new java.net.URL(KPSPublicSoap_address); 46 | } 47 | catch (java.net.MalformedURLException e) { 48 | throw new javax.xml.rpc.ServiceException(e); 49 | } 50 | return getKPSPublicSoap(endpoint); 51 | } 52 | 53 | public tr.gov.nvi.tckimlik.WS.KPSPublicSoap getKPSPublicSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { 54 | try { 55 | tr.gov.nvi.tckimlik.WS.KPSPublicSoapStub _stub = new tr.gov.nvi.tckimlik.WS.KPSPublicSoapStub(portAddress, this); 56 | _stub.setPortName(getKPSPublicSoapWSDDServiceName()); 57 | return _stub; 58 | } 59 | catch (org.apache.axis.AxisFault e) { 60 | return null; 61 | } 62 | } 63 | 64 | public void setKPSPublicSoapEndpointAddress(java.lang.String address) { 65 | KPSPublicSoap_address = address; 66 | } 67 | 68 | /** 69 | * For the given interface, get the stub implementation. 70 | * If this service has no port for the given interface, 71 | * then ServiceException is thrown. 72 | */ 73 | public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { 74 | try { 75 | if (tr.gov.nvi.tckimlik.WS.KPSPublicSoap.class.isAssignableFrom(serviceEndpointInterface)) { 76 | tr.gov.nvi.tckimlik.WS.KPSPublicSoapStub _stub = new tr.gov.nvi.tckimlik.WS.KPSPublicSoapStub(new java.net.URL(KPSPublicSoap_address), this); 77 | _stub.setPortName(getKPSPublicSoapWSDDServiceName()); 78 | return _stub; 79 | } 80 | } 81 | catch (java.lang.Throwable t) { 82 | throw new javax.xml.rpc.ServiceException(t); 83 | } 84 | throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); 85 | } 86 | 87 | /** 88 | * For the given interface, get the stub implementation. 89 | * If this service has no port for the given interface, 90 | * then ServiceException is thrown. 91 | */ 92 | public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { 93 | if (portName == null) { 94 | return getPort(serviceEndpointInterface); 95 | } 96 | java.lang.String inputPortName = portName.getLocalPart(); 97 | if ("KPSPublicSoap".equals(inputPortName)) { 98 | return getKPSPublicSoap(); 99 | } 100 | else { 101 | java.rmi.Remote _stub = getPort(serviceEndpointInterface); 102 | ((org.apache.axis.client.Stub) _stub).setPortName(portName); 103 | return _stub; 104 | } 105 | } 106 | 107 | public javax.xml.namespace.QName getServiceName() { 108 | return new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "KPSPublic"); 109 | } 110 | 111 | private java.util.HashSet ports = null; 112 | 113 | public java.util.Iterator getPorts() { 114 | if (ports == null) { 115 | ports = new java.util.HashSet(); 116 | ports.add(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "KPSPublicSoap")); 117 | } 118 | return ports.iterator(); 119 | } 120 | 121 | /** 122 | * Set the endpoint address for the specified port name. 123 | */ 124 | public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { 125 | 126 | if ("KPSPublicSoap".equals(portName)) { 127 | setKPSPublicSoapEndpointAddress(address); 128 | } 129 | else 130 | { // Unknown Port Name 131 | throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); 132 | } 133 | } 134 | 135 | /** 136 | * Set the endpoint address for the specified port name. 137 | */ 138 | public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { 139 | setEndpointAddress(portName.getLocalPart(), address); 140 | } 141 | 142 | } 143 | -------------------------------------------------------------------------------- /GameProject/src/tr/gov/nvi/tckimlik/WS/KPSPublicSoap.java: -------------------------------------------------------------------------------- 1 | /** 2 | * KPSPublicSoap.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package tr.gov.nvi.tckimlik.WS; 9 | 10 | public interface KPSPublicSoap extends java.rmi.Remote { 11 | public boolean TCKimlikNoDogrula(long TCKimlikNo, java.lang.String ad, java.lang.String soyad, int dogumYili) throws java.rmi.RemoteException; 12 | } 13 | -------------------------------------------------------------------------------- /GameProject/src/tr/gov/nvi/tckimlik/WS/KPSPublicSoapProxy.java: -------------------------------------------------------------------------------- 1 | package tr.gov.nvi.tckimlik.WS; 2 | 3 | public class KPSPublicSoapProxy implements tr.gov.nvi.tckimlik.WS.KPSPublicSoap { 4 | private String _endpoint = null; 5 | private tr.gov.nvi.tckimlik.WS.KPSPublicSoap kPSPublicSoap = null; 6 | 7 | public KPSPublicSoapProxy() { 8 | _initKPSPublicSoapProxy(); 9 | } 10 | 11 | public KPSPublicSoapProxy(String endpoint) { 12 | _endpoint = endpoint; 13 | _initKPSPublicSoapProxy(); 14 | } 15 | 16 | private void _initKPSPublicSoapProxy() { 17 | try { 18 | kPSPublicSoap = (new tr.gov.nvi.tckimlik.WS.KPSPublicLocator()).getKPSPublicSoap(); 19 | if (kPSPublicSoap != null) { 20 | if (_endpoint != null) 21 | ((javax.xml.rpc.Stub)kPSPublicSoap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); 22 | else 23 | _endpoint = (String)((javax.xml.rpc.Stub)kPSPublicSoap)._getProperty("javax.xml.rpc.service.endpoint.address"); 24 | } 25 | 26 | } 27 | catch (javax.xml.rpc.ServiceException serviceException) {} 28 | } 29 | 30 | public String getEndpoint() { 31 | return _endpoint; 32 | } 33 | 34 | public void setEndpoint(String endpoint) { 35 | _endpoint = endpoint; 36 | if (kPSPublicSoap != null) 37 | ((javax.xml.rpc.Stub)kPSPublicSoap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); 38 | 39 | } 40 | 41 | public tr.gov.nvi.tckimlik.WS.KPSPublicSoap getKPSPublicSoap() { 42 | if (kPSPublicSoap == null) 43 | _initKPSPublicSoapProxy(); 44 | return kPSPublicSoap; 45 | } 46 | 47 | public boolean TCKimlikNoDogrula(long TCKimlikNo, java.lang.String ad, java.lang.String soyad, int dogumYili) throws java.rmi.RemoteException{ 48 | if (kPSPublicSoap == null) 49 | _initKPSPublicSoapProxy(); 50 | return kPSPublicSoap.TCKimlikNoDogrula(TCKimlikNo, ad, soyad, dogumYili); 51 | } 52 | 53 | 54 | } -------------------------------------------------------------------------------- /GameProject/src/tr/gov/nvi/tckimlik/WS/KPSPublicSoapStub.java: -------------------------------------------------------------------------------- 1 | /** 2 | * KPSPublicSoapStub.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package tr.gov.nvi.tckimlik.WS; 9 | 10 | public class KPSPublicSoapStub extends org.apache.axis.client.Stub implements tr.gov.nvi.tckimlik.WS.KPSPublicSoap { 11 | private java.util.Vector cachedSerClasses = new java.util.Vector(); 12 | private java.util.Vector cachedSerQNames = new java.util.Vector(); 13 | private java.util.Vector cachedSerFactories = new java.util.Vector(); 14 | private java.util.Vector cachedDeserFactories = new java.util.Vector(); 15 | 16 | static org.apache.axis.description.OperationDesc [] _operations; 17 | 18 | static { 19 | _operations = new org.apache.axis.description.OperationDesc[1]; 20 | _initOperationDesc1(); 21 | } 22 | 23 | private static void _initOperationDesc1(){ 24 | org.apache.axis.description.OperationDesc oper; 25 | org.apache.axis.description.ParameterDesc param; 26 | oper = new org.apache.axis.description.OperationDesc(); 27 | oper.setName("TCKimlikNoDogrula"); 28 | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "TCKimlikNo"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); 29 | oper.addParameter(param); 30 | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "Ad"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); 31 | param.setOmittable(true); 32 | oper.addParameter(param); 33 | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "Soyad"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); 34 | param.setOmittable(true); 35 | oper.addParameter(param); 36 | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "DogumYili"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); 37 | oper.addParameter(param); 38 | oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); 39 | oper.setReturnClass(boolean.class); 40 | oper.setReturnQName(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "TCKimlikNoDogrulaResult")); 41 | oper.setStyle(org.apache.axis.constants.Style.WRAPPED); 42 | oper.setUse(org.apache.axis.constants.Use.LITERAL); 43 | _operations[0] = oper; 44 | 45 | } 46 | 47 | public KPSPublicSoapStub() throws org.apache.axis.AxisFault { 48 | this(null); 49 | } 50 | 51 | public KPSPublicSoapStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { 52 | this(service); 53 | super.cachedEndpoint = endpointURL; 54 | } 55 | 56 | public KPSPublicSoapStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { 57 | if (service == null) { 58 | super.service = new org.apache.axis.client.Service(); 59 | } else { 60 | super.service = service; 61 | } 62 | ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); 63 | } 64 | 65 | protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { 66 | try { 67 | org.apache.axis.client.Call _call = super._createCall(); 68 | if (super.maintainSessionSet) { 69 | _call.setMaintainSession(super.maintainSession); 70 | } 71 | if (super.cachedUsername != null) { 72 | _call.setUsername(super.cachedUsername); 73 | } 74 | if (super.cachedPassword != null) { 75 | _call.setPassword(super.cachedPassword); 76 | } 77 | if (super.cachedEndpoint != null) { 78 | _call.setTargetEndpointAddress(super.cachedEndpoint); 79 | } 80 | if (super.cachedTimeout != null) { 81 | _call.setTimeout(super.cachedTimeout); 82 | } 83 | if (super.cachedPortName != null) { 84 | _call.setPortName(super.cachedPortName); 85 | } 86 | java.util.Enumeration keys = super.cachedProperties.keys(); 87 | while (keys.hasMoreElements()) { 88 | java.lang.String key = (java.lang.String) keys.nextElement(); 89 | _call.setProperty(key, super.cachedProperties.get(key)); 90 | } 91 | return _call; 92 | } 93 | catch (java.lang.Throwable _t) { 94 | throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); 95 | } 96 | } 97 | 98 | public boolean TCKimlikNoDogrula(long TCKimlikNo, java.lang.String ad, java.lang.String soyad, int dogumYili) throws java.rmi.RemoteException { 99 | if (super.cachedEndpoint == null) { 100 | throw new org.apache.axis.NoEndPointException(); 101 | } 102 | org.apache.axis.client.Call _call = createCall(); 103 | _call.setOperation(_operations[0]); 104 | _call.setUseSOAPAction(true); 105 | _call.setSOAPActionURI("http://tckimlik.nvi.gov.tr/WS/TCKimlikNoDogrula"); 106 | _call.setEncodingStyle(null); 107 | _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); 108 | _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); 109 | _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); 110 | _call.setOperationName(new javax.xml.namespace.QName("http://tckimlik.nvi.gov.tr/WS", "TCKimlikNoDogrula")); 111 | 112 | setRequestHeaders(_call); 113 | setAttachments(_call); 114 | try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(TCKimlikNo), ad, soyad, new java.lang.Integer(dogumYili)}); 115 | 116 | if (_resp instanceof java.rmi.RemoteException) { 117 | throw (java.rmi.RemoteException)_resp; 118 | } 119 | else { 120 | extractAttachments(_call); 121 | try { 122 | return ((java.lang.Boolean) _resp).booleanValue(); 123 | } catch (java.lang.Exception _exception) { 124 | return ((java.lang.Boolean) org.apache.axis.utils.JavaUtils.convert(_resp, boolean.class)).booleanValue(); 125 | } 126 | } 127 | } catch (org.apache.axis.AxisFault axisFaultException) { 128 | throw axisFaultException; 129 | } 130 | } 131 | 132 | } 133 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JavaBootCamp ![image](https://user-images.githubusercontent.com/61596919/117068509-0b095e00-ad34-11eb-81d7-30c9dc3a4c50.png) 2 | 3 | https://www.kodlama.io/courses/enrolled/1332369 4 | 5 | Engin DEMIROG yotube javaBootCamp HW ve projeler 6 | 7 |

Java & React Bootcamp (https://kodlama.io/)

8 |

Lectures

9 |
    10 |
  • Lecture 1 11 |
      12 |
    • intro
    • 13 |
    14 |
      15 |
    16 |
  • 17 |
  • Lecture 2 18 |
      19 |
    • oopIntro
    • 20 |
    • homework
    • 21 |
    22 |
  • 23 |
  • Lecture 3 24 |
      25 |
    • oopIntro2
    • 26 |
    • inheritance
    • 27 |
    • inheritance2
    • 28 |
    • homework
    • 29 |
    30 |
  • 31 |
  • Lecture 4 32 |
      33 |
    • interface
    • 34 |
    • homework2
    • 35 |
    • homework3
    • 36 |
    37 |
  • 38 |
  • Lecture 5 39 |
      40 |
    • nLayeredDemo
    • 41 |
    • homework
    • 42 |
    43 |
  • 44 |
  • Lecture 6 45 |
      46 |
    • springIntro
    • 47 |
    • homework2
    • 48 |
    49 |
  • 50 |
  • Lecture 7 51 |
      52 |
    • swaggerAndResult
    • 53 |
    54 |
  • 55 |
  • Lecture 8 56 |
      57 |
    • Spring JPA/Hibernate
    • 58 |
    59 |
  • 60 |
  • Lecture 9 61 |
      62 |
    • Spring AOP
    • 63 |
    64 |
  • 65 |
  • Lecture 10 66 |
      67 |
    • Spring Security
    • 68 |
    69 |
  • 70 |
71 | 72 | Inceleyip oneri ve goruslerinizi melikkrc25@gmail.com adresine iletebilirsiniz. 73 | 74 | Yildiz vermeyi unutmayalım.:) 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/Abstract Sınıflarla Çalışmak/GameCalculator.java: -------------------------------------------------------------------------------- 1 | public abstract class GameCalculator { 2 | public abstract void hesapla(); 3 | public final void gameover(){ 4 | System.out.println("Oyun bitti!"); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/Abstract Sınıflarla Çalışmak/KidsGameCalculator.java: -------------------------------------------------------------------------------- 1 | public class KidsGameCalculator extends GameCalculator { 2 | 3 | @Override 4 | public void hesapla() { 5 | System.out.println("Puanınız : 100"); 6 | 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/Abstract Sınıflarla Çalışmak/Main.java: -------------------------------------------------------------------------------- 1 | public class Main{ 2 | public static void main(String[] args) { 3 | WomanGameCalculator womanGameCalculator=new WomanGameCalculator(); 4 | womanGameCalculator.hesapla(); 5 | womanGameCalculator.gameover(); 6 | 7 | GameCalculator gameCalculator =new WomanGameCalculator(); 8 | } 9 | } -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/Abstract Sınıflarla Çalışmak/ManGameCalculator.java: -------------------------------------------------------------------------------- 1 | public class ManGameCalculator extends GameCalculator { 2 | public void hesapla(){ 3 | System.out.println("Puanınız : 90"); 4 | 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/Abstract Sınıflarla Çalışmak/WomanGameCalculator.java: -------------------------------------------------------------------------------- 1 | public class WomanGameCalculator extends GameCalculator { 2 | public void hesapla(){ 3 | System.out.println("Puanınız : 95"); 4 | 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/AbstractDemo/BaseDatabaseManager.java: -------------------------------------------------------------------------------- 1 | package video41AbstractDemo; 2 | 3 | public abstract class BaseDatabaseManager { 4 | public abstract void getData(); 5 | } 6 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/AbstractDemo/CustomerManager.java: -------------------------------------------------------------------------------- 1 | package video41AbstractDemo; 2 | 3 | public class CustomerManager { 4 | 5 | BaseDatabaseManager databaseManager; 6 | public void getCustomers(){ 7 | databaseManager.getData(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/AbstractDemo/Main.java: -------------------------------------------------------------------------------- 1 | package video41AbstractDemo; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | CustomerManager customerManager=new CustomerManager(); 6 | customerManager.databaseManager=new OracleDatabaseManager(); 7 | customerManager.getCustomers(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/AbstractDemo/OracleDatabaseManager.java: -------------------------------------------------------------------------------- 1 | package video41AbstractDemo; 2 | 3 | public class OracleDatabaseManager extends BaseDatabaseManager { 4 | 5 | @Override 6 | public void getData() { 7 | // TODO Auto-generated method stub 8 | System.out.println("veri getirildi oracle"); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/AbstractDemo/SqlServerDatabaseManager.java: -------------------------------------------------------------------------------- 1 | package video41AbstractDemo; 2 | 3 | public class SqlServerDatabaseManager extends BaseDatabaseManager { 4 | 5 | @Override 6 | public void getData() { 7 | // TODO Auto-generated method stub 8 | System.out.println("veri getirildi sql server"); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaceDemo/IEatable.java: -------------------------------------------------------------------------------- 1 | public interface IEatable { 2 | void eat(); 3 | } 4 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaceDemo/IPayable.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | public interface IPayable { 4 | void pay(); 5 | } 6 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaceDemo/IWorkable.java: -------------------------------------------------------------------------------- 1 | public interface IWorkable { 2 | void work(); 3 | } 4 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaceDemo/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | public static void main(String[] args) { 3 | 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaceDemo/OutsourceWorker.java: -------------------------------------------------------------------------------- 1 | public class OutsourceWorker implements IWorkable { 2 | @Override 3 | public void work() { 4 | // TODO Auto-generated method stub 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaceDemo/Worker.java: -------------------------------------------------------------------------------- 1 | public class Worker implements IWorkable,IEatable,IPayable{ 2 | @Override 3 | public void work() { 4 | // TODO Auto-generated method stub 5 | 6 | } 7 | 8 | @Override 9 | public void eat() { 10 | // TODO Auto-generated method stub 11 | 12 | } 13 | 14 | @Override 15 | public void pay() { 16 | // TODO Auto-generated method stub 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaces/CustomerManager.java: -------------------------------------------------------------------------------- 1 | 2 | //video43 devamı 3 | public class CustomerManager { 4 | private ICustomerDal customerDal; 5 | public CustomerManager(ICustomerDal customerDal){ 6 | this.customerDal=customerDal; 7 | } 8 | public void add(){ 9 | //iş kodları 10 | customerDal.Add(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaces/ICustomerDal.java: -------------------------------------------------------------------------------- 1 | 2 | //interfacesler class değildir. 3 | public interface ICustomerDal { 4 | void Add(); 5 | } 6 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaces/IRepository.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | public interface IRepository { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaces/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | public static void main(String[] args) { 3 | CustomerManager customerManager=new CustomerManager(new OracleCustomerDal()); 4 | customerManager.add(); 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaces/MySqlCustomerDal.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | public class MySqlCustomerDal implements ICustomerDal,IRepository { 4 | 5 | @Override 6 | public void Add() { 7 | // TODO Auto-generated method stub 8 | System.out.println("My sql eklendi."); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaces/OlderGameCalculator.java: -------------------------------------------------------------------------------- 1 | public class OlderGameCalculator extends GameCalculator { 2 | 3 | @Override 4 | public void hesapla() { 5 | // TODO Auto-generated method stub 6 | 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /YouTubeUygulamalari/Day4HW1/interfaces/OracleCustomerDal.java: -------------------------------------------------------------------------------- 1 | 2 | public class OracleCustomerDal implements ICustomerDal{ 3 | 4 | @Override 5 | public void Add() { 6 | // TODO Auto-generated method stub 7 | System.out.println("Oracle eklendi"); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /hrms/hrms/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/) 8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/#build-image) 9 | * [Spring Data JPA](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#boot-features-jpa-and-spring-data) 10 | * [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#using-boot-devtools) 11 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/#boot-features-developing-web-applications) 12 | 13 | ### Guides 14 | The following guides illustrate how to use some features concretely: 15 | 16 | * [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/) 17 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 18 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 19 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 20 | 21 | -------------------------------------------------------------------------------- /hrms/hrms/easywsdl/ExKsoap2-1.0.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/hrms/hrms/easywsdl/ExKsoap2-1.0.3.1.jar -------------------------------------------------------------------------------- /hrms/hrms/easywsdl/ksoap2-android-assembly-3.6.4-jar-with-dependencies.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/hrms/hrms/easywsdl/ksoap2-android-assembly-3.6.4-jar-with-dependencies.jar -------------------------------------------------------------------------------- /hrms/hrms/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /hrms/hrms/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /hrms/hrms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | kariyernet 12 | hrms 13 | 0.0.1-SNAPSHOT 14 | hrms 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | org.postgresql 37 | postgresql 38 | runtime 39 | 40 | 41 | org.projectlombok 42 | lombok 43 | true 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-test 48 | test 49 | 50 | 51 | 52 | 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-maven-plugin 57 | 58 | 59 | 60 | org.projectlombok 61 | lombok 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /hrms/hrms/src/main/java/kariyernet/hrms/HrmsApplication.java: -------------------------------------------------------------------------------- 1 | package kariyernet.hrms; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class HrmsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(HrmsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /hrms/hrms/src/main/java/kariyernet/hrms/api/controllers/JobPositionsController.java: -------------------------------------------------------------------------------- 1 | package kariyernet.hrms.api.controllers; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import kariyernet.hrms.business.abstracts.JobPositionService; 11 | import kariyernet.hrms.entities.concretes.JobPosition; 12 | @RestController 13 | @RequestMapping("/api/jobpositions") 14 | public class JobPositionsController { 15 | private JobPositionService jobPositionService; 16 | 17 | @Autowired 18 | public JobPositionsController(JobPositionService jobPositionService) { 19 | super(); 20 | this.jobPositionService = jobPositionService; 21 | } 22 | 23 | @GetMapping("/getall") 24 | public List getAll(){ 25 | return this.jobPositionService.getAll(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /hrms/hrms/src/main/java/kariyernet/hrms/business/abstracts/JobPositionService.java: -------------------------------------------------------------------------------- 1 | package kariyernet.hrms.business.abstracts; 2 | 3 | import java.util.List; 4 | import kariyernet.hrms.entities.concretes.JobPosition; 5 | public interface JobPositionService { 6 | List getAll(); 7 | } 8 | -------------------------------------------------------------------------------- /hrms/hrms/src/main/java/kariyernet/hrms/business/concretes/JobPositionManager.java: -------------------------------------------------------------------------------- 1 | package kariyernet.hrms.business.concretes; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import kariyernet.hrms.business.abstracts.JobPositionService; 9 | import kariyernet.hrms.dataAccess.abstracts.JobPositionDao; 10 | import kariyernet.hrms.entities.concretes.JobPosition; 11 | @Service 12 | public class JobPositionManager implements JobPositionService { 13 | private JobPositionDao jobPositionDao; 14 | 15 | @Autowired 16 | 17 | public JobPositionManager(JobPositionDao jobPositionDao) { 18 | super(); 19 | this.jobPositionDao = jobPositionDao; 20 | } 21 | 22 | @Override 23 | public List getAll() { 24 | 25 | return this.jobPositionDao.findAll(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /hrms/hrms/src/main/java/kariyernet/hrms/dataAccess/abstracts/JobPositionDao.java: -------------------------------------------------------------------------------- 1 | package kariyernet.hrms.dataAccess.abstracts; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import kariyernet.hrms.entities.concretes.JobPosition; 6 | 7 | public interface JobPositionDao extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /hrms/hrms/src/main/java/kariyernet/hrms/entities/concretes/JobPosition.java: -------------------------------------------------------------------------------- 1 | package kariyernet.hrms.entities.concretes; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.GeneratedValue; 6 | import javax.persistence.Id; 7 | import javax.persistence.Table; 8 | 9 | @Entity 10 | @Table(name="Position") 11 | public class JobPosition { 12 | @Id 13 | @GeneratedValue 14 | @Column(name="id") 15 | private int id; 16 | @Column(name="name") 17 | private String name; 18 | public JobPosition() { 19 | 20 | } 21 | public JobPosition(int id, String name) { 22 | super(); 23 | this.id = id; 24 | this.name = name; 25 | } 26 | public int getId() { 27 | return id; 28 | } 29 | public void setId(int id) { 30 | this.id = id; 31 | } 32 | public String getName() { 33 | return name; 34 | } 35 | public void setName(String name) { 36 | this.name = name; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /hrms/hrms/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/Hrms 5 | spring.datasource.username=postgres 6 | spring.datasource.password=252018 7 | spring.jpa.properties.javax.persistence.validation.mode = none 8 | -------------------------------------------------------------------------------- /hrms/hrms/src/test/java/kariyernet/hrms/HrmsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package kariyernet.hrms; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class HrmsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /hrms/hrms/target/classes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Build-Jdk-Spec: 16 3 | Implementation-Title: hrms 4 | Implementation-Version: 0.0.1-SNAPSHOT 5 | Created-By: Maven Integration for Eclipse 6 | 7 | -------------------------------------------------------------------------------- /hrms/hrms/target/classes/META-INF/maven/kariyernet/hrms/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Sun May 23 01:14:04 TRT 2021 3 | m2e.projectLocation=C\:\\Users\\mkaraca\\eclipse-workspace\\hrms\\hrms 4 | m2e.projectName=hrms 5 | groupId=kariyernet 6 | artifactId=hrms 7 | version=0.0.1-SNAPSHOT 8 | -------------------------------------------------------------------------------- /hrms/hrms/target/classes/META-INF/maven/kariyernet/hrms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | kariyernet 12 | hrms 13 | 0.0.1-SNAPSHOT 14 | hrms 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | org.postgresql 37 | postgresql 38 | runtime 39 | 40 | 41 | org.projectlombok 42 | lombok 43 | true 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-test 48 | test 49 | 50 | 51 | 52 | 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-maven-plugin 57 | 58 | 59 | 60 | org.projectlombok 61 | lombok 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /hrms/hrms/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/Hrms 5 | spring.datasource.username=postgres 6 | spring.datasource.password=252018 7 | spring.jpa.properties.javax.persistence.validation.mode = none 8 | -------------------------------------------------------------------------------- /hrms/hrms/target/classes/kariyernet/hrms/HrmsApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/hrms/hrms/target/classes/kariyernet/hrms/HrmsApplication.class -------------------------------------------------------------------------------- /hrms/hrms/target/classes/kariyernet/hrms/api/controllers/JobPositionsController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/hrms/hrms/target/classes/kariyernet/hrms/api/controllers/JobPositionsController.class -------------------------------------------------------------------------------- /hrms/hrms/target/classes/kariyernet/hrms/business/abstracts/JobPositionService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/hrms/hrms/target/classes/kariyernet/hrms/business/abstracts/JobPositionService.class -------------------------------------------------------------------------------- /hrms/hrms/target/classes/kariyernet/hrms/business/concretes/JobPositionManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/hrms/hrms/target/classes/kariyernet/hrms/business/concretes/JobPositionManager.class -------------------------------------------------------------------------------- /hrms/hrms/target/classes/kariyernet/hrms/dataAccess/abstracts/JobPositionDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/hrms/hrms/target/classes/kariyernet/hrms/dataAccess/abstracts/JobPositionDao.class -------------------------------------------------------------------------------- /hrms/hrms/target/classes/kariyernet/hrms/entities/concretes/JobPosition.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/hrms/hrms/target/classes/kariyernet/hrms/entities/concretes/JobPosition.class -------------------------------------------------------------------------------- /hrms/hrms/target/test-classes/kariyernet/hrms/HrmsApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/hrms/hrms/target/test-classes/kariyernet/hrms/HrmsApplicationTests.class -------------------------------------------------------------------------------- /javaKampHafta3Odev2/Instructor.java: -------------------------------------------------------------------------------- 1 | package javaKampHafta3Odev2; 2 | 3 | public class Instructor extends User { 4 | private String details; 5 | 6 | public void Instructor() { 7 | 8 | } 9 | 10 | public Instructor() { 11 | super(); 12 | this.details = details; 13 | } 14 | 15 | public String getDetails() { 16 | return details; 17 | } 18 | 19 | public void setDetails(String details) { 20 | this.details = details; 21 | } 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /javaKampHafta3Odev2/InstructorManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/javaKampHafta3Odev2/InstructorManager.java -------------------------------------------------------------------------------- /javaKampHafta3Odev2/Main.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/javaKampHafta3Odev2/Main.java -------------------------------------------------------------------------------- /javaKampHafta3Odev2/Student.java: -------------------------------------------------------------------------------- 1 | package javaKampHafta3Odev2; 2 | 3 | public class Student extends User{ 4 | int completingPercentage; 5 | public Student() { 6 | 7 | } 8 | public Student(String firstName, String lastName, String address, String email, int userId,int completingPercentage) { 9 | super(); 10 | this.completingPercentage = completingPercentage; 11 | } 12 | public int getCompletingPercentage() { 13 | return completingPercentage; 14 | } 15 | public void setCompletingPercentage(int completingPercentage) { 16 | this.completingPercentage = completingPercentage; 17 | } 18 | 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /javaKampHafta3Odev2/StudentManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/javaKampHafta3Odev2/StudentManager.java -------------------------------------------------------------------------------- /javaKampHafta3Odev2/User.java: -------------------------------------------------------------------------------- 1 | package javaKampHafta3Odev2; 2 | 3 | public class User { 4 | private String firstName; 5 | private String lastName; 6 | private String address; 7 | private String email; 8 | private int userId; 9 | 10 | public User() { 11 | 12 | } 13 | public User(String firstName, String lastName, String address, String email, int userId) { 14 | super(); 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.address = address; 18 | this.email = email; 19 | this.userId = userId; 20 | } 21 | public String getFirstName() { 22 | return firstName; 23 | } 24 | public void setFirstName(String firstName) { 25 | this.firstName = firstName; 26 | } 27 | public String getLastName() { 28 | return lastName; 29 | } 30 | public void setLastName(String lastName) { 31 | this.lastName = lastName; 32 | } 33 | public String getAddress() { 34 | return address; 35 | } 36 | public void setAddress(String address) { 37 | this.address = address; 38 | } 39 | public String getEmail() { 40 | return email; 41 | } 42 | public void setEmail(String email) { 43 | this.email = email; 44 | } 45 | public int getUserId() { 46 | return userId; 47 | } 48 | public void setUserId(int userId) { 49 | this.userId = userId; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /javaKampHafta3Odev2/UserManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/javaKampHafta3Odev2/UserManager.java -------------------------------------------------------------------------------- /nLayeredDemo/bin/nLayeredDemo/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/bin/nLayeredDemo/Main.class -------------------------------------------------------------------------------- /nLayeredDemo/bin/nLayeredDemo/business/abstracts/ProductService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/bin/nLayeredDemo/business/abstracts/ProductService.class -------------------------------------------------------------------------------- /nLayeredDemo/bin/nLayeredDemo/business/concretes/ProductManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/bin/nLayeredDemo/business/concretes/ProductManager.class -------------------------------------------------------------------------------- /nLayeredDemo/bin/nLayeredDemo/core/JLoggerManagerAdaptor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/bin/nLayeredDemo/core/JLoggerManagerAdaptor.class -------------------------------------------------------------------------------- /nLayeredDemo/bin/nLayeredDemo/core/LoggerService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/bin/nLayeredDemo/core/LoggerService.class -------------------------------------------------------------------------------- /nLayeredDemo/bin/nLayeredDemo/dataAccess/abstracts/ProductDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/bin/nLayeredDemo/dataAccess/abstracts/ProductDao.class -------------------------------------------------------------------------------- /nLayeredDemo/bin/nLayeredDemo/dataAccess/concretes/AbcProductDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/bin/nLayeredDemo/dataAccess/concretes/AbcProductDao.class -------------------------------------------------------------------------------- /nLayeredDemo/bin/nLayeredDemo/dataAccess/concretes/HibernateProductDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/bin/nLayeredDemo/dataAccess/concretes/HibernateProductDao.class -------------------------------------------------------------------------------- /nLayeredDemo/bin/nLayeredDemo/entities/abstracts/Entity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/bin/nLayeredDemo/entities/abstracts/Entity.class -------------------------------------------------------------------------------- /nLayeredDemo/bin/nLayeredDemo/entities/concretes/Product.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/bin/nLayeredDemo/entities/concretes/Product.class -------------------------------------------------------------------------------- /nLayeredDemo/bin/nLayeredDemo/jLogger/JLoggerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/bin/nLayeredDemo/jLogger/JLoggerManager.class -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/Main.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/src/nLayeredDemo/Main.java -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/business/abstracts/ProductService.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import nLayeredDemo.entities.concretes.Product; 6 | 7 | public interface ProductService { 8 | void add(Product product); 9 | List getAll(); 10 | } 11 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/business/concretes/ProductManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/src/nLayeredDemo/business/concretes/ProductManager.java -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/core/JLoggerManagerAdaptor.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.core; 2 | 3 | import nLayeredDemo.jLogger.JLoggerManager; 4 | 5 | public class JLoggerManagerAdaptor implements LoggerService { 6 | 7 | @Override 8 | public void logToSystem(String message) { 9 | // TODO Auto-generated method stub 10 | JLoggerManager manager=new JLoggerManager(); 11 | manager.log(message); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/core/LoggerService.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.core; 2 | 3 | public interface LoggerService { 4 | void logToSystem(String message); 5 | } 6 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/dataAccess/abstracts/ProductDao.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import nLayeredDemo.entities.concretes.Product; 6 | 7 | public interface ProductDao { 8 | void add(Product product); 9 | 10 | void update(Product product); 11 | 12 | void delete(Product product); 13 | 14 | Product get(int id); 15 | 16 | List getAll(); 17 | } 18 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/dataAccess/concretes/AbcProductDao.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.dataAccess.concretes; 2 | 3 | import java.util.List; 4 | 5 | import nLayeredDemo.dataAccess.abstracts.ProductDao; 6 | import nLayeredDemo.entities.concretes.Product; 7 | 8 | public class AbcProductDao implements ProductDao { 9 | 10 | @Override 11 | public void add(Product product) { 12 | // TODO Auto-generated method stub 13 | System.out.println("Abc ile eklendi. "+product.getName()); 14 | } 15 | 16 | @Override 17 | public void update(Product product) { 18 | // TODO Auto-generated method stub 19 | 20 | } 21 | 22 | @Override 23 | public void delete(Product product) { 24 | // TODO Auto-generated method stub 25 | 26 | } 27 | 28 | @Override 29 | public Product get(int id) { 30 | // TODO Auto-generated method stub 31 | return null; 32 | } 33 | 34 | @Override 35 | public List getAll() { 36 | // TODO Auto-generated method stub 37 | return null; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/dataAccess/concretes/HibernateProductDao.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/src/nLayeredDemo/dataAccess/concretes/HibernateProductDao.java -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/entities/abstracts/Entity.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.entities.abstracts; 2 | 3 | public interface Entity { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/entities/concretes/Product.java: -------------------------------------------------------------------------------- 1 | package nLayeredDemo.entities.concretes; 2 | 3 | import nLayeredDemo.entities.abstracts.Entity; 4 | 5 | public class Product implements Entity{ 6 | private int id; 7 | private int categoryId; 8 | private String name; 9 | private double unitPrice; 10 | private int unitsInstock; 11 | 12 | public Product() { 13 | 14 | } 15 | 16 | public Product(int id, int categoryId, String name, double unitPrice, int unitsInstock) { 17 | super(); 18 | this.id = id; 19 | this.categoryId = categoryId; 20 | this.name = name; 21 | this.unitPrice = unitPrice; 22 | this.unitsInstock = unitsInstock; 23 | } 24 | 25 | public int getId() { 26 | return id; 27 | } 28 | 29 | public void setId(int id) { 30 | this.id = id; 31 | } 32 | 33 | public int getCategoryId() { 34 | return categoryId; 35 | } 36 | 37 | public void setCategoryId(int categoryId) { 38 | this.categoryId = categoryId; 39 | } 40 | 41 | public String getName() { 42 | return name; 43 | } 44 | 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | public double getUnitPrice() { 50 | return unitPrice; 51 | } 52 | 53 | public void setUnitPrice(double unitPrice) { 54 | this.unitPrice = unitPrice; 55 | } 56 | 57 | public int getUnitsInstock() { 58 | return unitsInstock; 59 | } 60 | 61 | public void setUnitsInstock(int unitsInstock) { 62 | this.unitsInstock = unitsInstock; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /nLayeredDemo/src/nLayeredDemo/jLogger/JLoggerManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/nLayeredDemo/src/nLayeredDemo/jLogger/JLoggerManager.java -------------------------------------------------------------------------------- /northwind/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /northwind/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /northwind/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | kodlamaio 12 | northwind 13 | 0.0.1-SNAPSHOT 14 | northwind 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | org.postgresql 37 | postgresql 38 | runtime 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-test 43 | test 44 | 45 | 46 | io.springfox 47 | springfox-swagger2 48 | 2.9.2 49 | 50 | 51 | org.projectlombok 52 | lombok 53 | true 54 | 55 | 56 | io.springfox 57 | springfox-swagger-ui 58 | 2.9.2 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | org.springframework.boot 67 | spring-boot-maven-plugin 68 | 69 | 70 | 71 | org.projectlombok 72 | lombok 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/NorthwindApplication.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.annotation.Bean; 7 | 8 | import springfox.documentation.builders.PathSelectors; 9 | import springfox.documentation.builders.RequestHandlerSelectors; 10 | import springfox.documentation.spi.DocumentationType; 11 | import springfox.documentation.spring.web.plugins.Docket; 12 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 13 | 14 | @SpringBootApplication 15 | @EnableSwagger2 16 | public class NorthwindApplication { 17 | 18 | public static void main(String[] args) { 19 | SpringApplication.run(NorthwindApplication.class, args); 20 | } 21 | @Bean 22 | public Docket api() { 23 | return new Docket(DocumentationType.SWAGGER_2) 24 | .select() 25 | .apis(RequestHandlerSelectors.basePackage("kodlamaio.northwind")) 26 | .paths(PathSelectors.any()) 27 | .build(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/api/controllers/ProductsController.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.api.controllers; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | 14 | 15 | import kodlamaio.northwind.business.abstracts.ProductService; 16 | import kodlamaio.northwind.core.utilities.results.DataResult; 17 | import kodlamaio.northwind.core.utilities.results.Result; 18 | import kodlamaio.northwind.entities.concretes.Product; 19 | 20 | @RestController 21 | @RequestMapping("/api/products") 22 | public class ProductsController { 23 | 24 | 25 | private ProductService productService; 26 | 27 | 28 | @Autowired 29 | public ProductsController(ProductService productService) { 30 | super(); 31 | this.productService = productService; 32 | } 33 | 34 | @GetMapping("/getall") 35 | public DataResult> getAll(){ 36 | return this.productService.getAll(); 37 | } 38 | /*@GetMapping("/add") 39 | public Result add(Product product){ 40 | return new Result(true,"Ürün eklendi."); 41 | }*/ 42 | @PostMapping("/add") 43 | public Result add(@RequestBody Product product) { 44 | return this.productService.add(product); 45 | 46 | } 47 | @GetMapping("/getByProductName") 48 | public DataResult getByProductName(@RequestParam String productName){ 49 | return this.productService.getByProductName(productName); 50 | } 51 | @GetMapping("/getByProductNameAndCategoryId") 52 | public DataResult 53 | getByProductNameAndCategoryId(@RequestParam("productName") String productName,@RequestParam("categoryId") int categoryId){ 54 | System.out.println(productName); 55 | System.out.println(categoryId); 56 | 57 | return this.productService.getByProductNameAndCategoryId 58 | (productName, categoryId); 59 | } 60 | 61 | @GetMapping("/getByProductNameContains") 62 | public DataResult> getByProductNameContains(@RequestParam String productName){ 63 | return this.productService.getByProductNameContains(productName); 64 | } 65 | 66 | @GetMapping("/getAllByPage") 67 | DataResult> getAll(int pageNo, int pageSize){ 68 | return this.productService.getAll(pageNo, pageSize); 69 | } 70 | 71 | @GetMapping("/getAllDesc") 72 | public DataResult> getAllSorted() { 73 | return this.productService.getAllSorted(); 74 | } 75 | 76 | 77 | } 78 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/business/abstracts/ProductService.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.Query; 6 | 7 | import kodlamaio.northwind.core.utilities.results.DataResult; 8 | import kodlamaio.northwind.core.utilities.results.Result; 9 | import kodlamaio.northwind.entities.concretes.Product; 10 | 11 | public interface ProductService { 12 | DataResult> getAll(); 13 | DataResult> getAllSorted(); 14 | DataResult> getAll(int pageNo, int pageSize); 15 | Result add(Product product); 16 | 17 | DataResult getByProductName(String productName); 18 | 19 | DataResult getByProductNameAndCategoryId(String productName, int categoryId); 20 | 21 | DataResult> getByProductNameOrCategoryId(String productName, int categoryId); 22 | 23 | DataResult> getByCategoryIdIn(List categories); 24 | 25 | DataResult> getByProductNameContains(String productName); 26 | 27 | DataResult> getByProductNameStartsWith(String productName); 28 | 29 | DataResult> getByNameAndCategory(String productName, int categoryId); 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/business/concretes/ProductManager.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.business.concretes; 2 | import java.util.List; 3 | 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.data.domain.PageRequest; 6 | import org.springframework.data.domain.Pageable; 7 | import org.springframework.data.domain.Sort; 8 | import org.springframework.stereotype.Service; 9 | 10 | import kodlamaio.northwind.business.abstracts.ProductService; 11 | import kodlamaio.northwind.core.utilities.results.DataResult; 12 | import kodlamaio.northwind.core.utilities.results.Result; 13 | import kodlamaio.northwind.core.utilities.results.SuccessDataResult; 14 | import kodlamaio.northwind.core.utilities.results.successResult; 15 | import kodlamaio.northwind.dataAccess.abstracts.ProductDao; 16 | import kodlamaio.northwind.entities.concretes.Product; 17 | 18 | @Service 19 | public class ProductManager implements ProductService{ 20 | 21 | private ProductDao productDao; 22 | 23 | @Autowired 24 | public ProductManager(ProductDao productDao) { 25 | super(); 26 | this.productDao = productDao; 27 | } 28 | 29 | @Override 30 | public DataResult> getAll() { 31 | 32 | return new SuccessDataResult> 33 | (this.productDao.findAll(),"Data listelendi"); 34 | 35 | } 36 | 37 | @Override 38 | public Result add(Product product) { 39 | this.productDao.save(product); 40 | return new successResult("Ürün eklendi"); 41 | } 42 | 43 | @Override 44 | public DataResult getByProductName(String productName) { 45 | return new SuccessDataResult 46 | (this.productDao.getByProductName(productName),"Data listelendi"); 47 | } 48 | 49 | @Override 50 | public DataResult getByProductNameAndCategoryId(String productName, int categoryId) { 51 | //business codes 52 | 53 | return new SuccessDataResult 54 | (this.productDao.getByProductNameAndCategory_CategoryId(productName, categoryId),"Data listelendi"); 55 | } 56 | 57 | @Override 58 | public DataResult> getByProductNameOrCategoryId(String productName, int categoryId) { 59 | return new SuccessDataResult> 60 | (this.productDao.getByProductNameOrCategory_CategoryId(productName, categoryId),"Data listelendi"); 61 | } 62 | 63 | @Override 64 | public DataResult> getByCategoryIdIn(List categories) { 65 | return new SuccessDataResult> 66 | (this.productDao.getByCategoryIn(categories),"Data listelendi"); 67 | } 68 | 69 | @Override 70 | public DataResult> getByProductNameContains(String productName) { 71 | return new SuccessDataResult> 72 | (this.productDao.getByProductNameContains(productName),"Data listelendi"); 73 | } 74 | 75 | @Override 76 | public DataResult> getByProductNameStartsWith(String productName) { 77 | return new SuccessDataResult> 78 | (this.productDao.getByProductNameStartsWith(productName),"Data listelendi"); 79 | } 80 | 81 | @Override 82 | public DataResult> getByNameAndCategory(String productName, int categoryId) { 83 | return new SuccessDataResult> 84 | (this.productDao.getByNameAndCategory(productName,categoryId),"Data listelendi"); 85 | } 86 | 87 | @Override 88 | public DataResult> getAll(int pageNo, int pageSize) { 89 | PageRequest pageable=PageRequest.of(pageNo-1, pageSize); 90 | 91 | return new SuccessDataResult> 92 | (this.productDao.findAll(pageable).getContent()); 93 | } 94 | @Override 95 | public DataResult> getAllSorted() { 96 | Sort sort = Sort.by(Sort.Direction.DESC,"productName"); 97 | return new SuccessDataResult> 98 | (this.productDao.findAll(sort),"Başarılı"); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/core/utilities/results/DataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class DataResult extends Result { 4 | 5 | private T data; 6 | public DataResult(T data, boolean success, String message) { 7 | super(success, message); 8 | this.data=data; 9 | 10 | } 11 | 12 | public DataResult(T data, boolean success) { 13 | super(success); 14 | this.data=data; 15 | 16 | } 17 | public T getData() { 18 | return this.data; 19 | } 20 | 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/core/utilities/results/ErrorDataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class ErrorDataResult extends DataResult { 4 | public ErrorDataResult(T data, String message) { 5 | super(data, false, message); 6 | 7 | } 8 | 9 | public ErrorDataResult(T data) { 10 | super(data,false); 11 | } 12 | 13 | public ErrorDataResult(String message) { 14 | super(null, false, message); 15 | 16 | } 17 | public ErrorDataResult() { 18 | super(null, false); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/core/utilities/results/ErrorResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class ErrorResult extends Result { 4 | 5 | public ErrorResult() { 6 | super(false); 7 | } 8 | 9 | public ErrorResult(String message) { 10 | super(false,message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/core/utilities/results/Result.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class Result { 4 | private boolean success; 5 | private String message; 6 | 7 | public Result(boolean success) { 8 | this.success=success; 9 | } 10 | 11 | public Result(boolean success,String message) { 12 | this(success); 13 | this.message=message; 14 | 15 | } 16 | 17 | public boolean isSuccess() { 18 | return this.success; 19 | } 20 | public String getMessage() { 21 | return this.message; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/core/utilities/results/SuccessDataResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class SuccessDataResult extends DataResult { 4 | 5 | public SuccessDataResult(T data, String message) { 6 | super(data, true, message); 7 | 8 | } 9 | 10 | public SuccessDataResult(T data) { 11 | super(data,true); 12 | } 13 | 14 | public SuccessDataResult(String message) { 15 | super(null, true, message); 16 | 17 | } 18 | public SuccessDataResult() { 19 | super(null, true); 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/core/utilities/results/successResult.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.core.utilities.results; 2 | 3 | public class successResult extends Result { 4 | public successResult() { 5 | super(true); 6 | } 7 | 8 | public successResult(String message) { 9 | super(true,message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/dataAccess/abstracts/ProductDao.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | 8 | import kodlamaio.northwind.entities.concretes.Product; 9 | 10 | public interface ProductDao extends JpaRepository{ 11 | Product getByProductName(String productName); 12 | 13 | Product getByProductNameAndCategory_CategoryId(String productName, int categoryId); 14 | 15 | List getByProductNameOrCategory_CategoryId(String productName, int categoryId); 16 | 17 | List getByCategoryIn(List categories); 18 | 19 | List getByProductNameContains(String productName); 20 | 21 | List getByProductNameStartsWith(String productName); 22 | 23 | @Query("From Product where productName=:productName and category.categoryId=:categoryId") 24 | List getByNameAndCategory(String productName, int categoryId); 25 | 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/entities/concretes/Category.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.entities.concretes; 2 | 3 | import java.util.List; 4 | import javax.persistence.Column; 5 | import javax.persistence.Entity; 6 | import javax.persistence.Id; 7 | import javax.persistence.OneToMany; 8 | import javax.persistence.Table; 9 | 10 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 11 | 12 | import lombok.AllArgsConstructor; 13 | import lombok.Data; 14 | import lombok.NoArgsConstructor; 15 | 16 | @Data 17 | @AllArgsConstructor 18 | @NoArgsConstructor 19 | @Table(name="categories") 20 | @Entity 21 | @JsonIgnoreProperties({"hibernateLazyInitializer","handler","products"}) 22 | public class Category { 23 | @Id 24 | @Column(name="category_id") 25 | private int categoryId; 26 | 27 | @Column(name="category_name") 28 | private String categoryName; 29 | 30 | @OneToMany(mappedBy = "category") 31 | private List products; 32 | 33 | } 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /northwind/src/main/java/kodlamaio/northwind/entities/concretes/Product.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind.entities.concretes; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.GeneratedValue; 6 | import javax.persistence.GenerationType; 7 | import javax.persistence.Id; 8 | import javax.persistence.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.persistence.Table; 11 | 12 | import org.hibernate.annotations.ManyToAny; 13 | 14 | import lombok.AllArgsConstructor; 15 | import lombok.Data; 16 | import lombok.NoArgsConstructor; 17 | @Data 18 | @AllArgsConstructor 19 | @NoArgsConstructor 20 | @Entity 21 | @Table(name="products") 22 | public class Product { 23 | 24 | @Id 25 | @GeneratedValue(strategy = GenerationType.IDENTITY) 26 | @Column(name="product_id") 27 | private int id; 28 | 29 | //@Column(name="category_id") 30 | //private int categoryId; 31 | 32 | @Column(name="product_name") 33 | private String productName; 34 | 35 | @Column(name="unit_price") 36 | private double unitPrice; 37 | 38 | @Column(name="units_in_stock") 39 | private short unitsInStock; 40 | 41 | @Column(name="quantity_per_unit") 42 | private String quantityPerUnit; 43 | 44 | @ManyToOne() 45 | @JoinColumn(name="category_id") 46 | private Category category; 47 | } 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /northwind/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/Northwind 5 | spring.datasource.username=postgres 6 | spring.datasource.password=252018 7 | spring.jpa.properties.javax.persistence.validation.mode = none -------------------------------------------------------------------------------- /northwind/src/test/java/kodlamaio/northwind/NorthwindApplicationTests.java: -------------------------------------------------------------------------------- 1 | package kodlamaio.northwind; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class NorthwindApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /northwind/target/classes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Build-Jdk-Spec: 16 3 | Implementation-Title: northwind 4 | Implementation-Version: 0.0.1-SNAPSHOT 5 | Created-By: Maven Integration for Eclipse 6 | 7 | -------------------------------------------------------------------------------- /northwind/target/classes/META-INF/maven/kodlamaio/northwind/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Thu May 27 23:31:51 TRT 2021 3 | m2e.projectLocation=C\:\\Users\\mkaraca\\eclipse-workspace\\northwind 4 | m2e.projectName=northwind 5 | groupId=kodlamaio 6 | artifactId=northwind 7 | version=0.0.1-SNAPSHOT 8 | -------------------------------------------------------------------------------- /northwind/target/classes/META-INF/maven/kodlamaio/northwind/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | kodlamaio 12 | northwind 13 | 0.0.1-SNAPSHOT 14 | northwind 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | org.postgresql 37 | postgresql 38 | runtime 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-test 43 | test 44 | 45 | 46 | io.springfox 47 | springfox-swagger2 48 | 2.9.2 49 | 50 | 51 | org.projectlombok 52 | lombok 53 | true 54 | 55 | 56 | io.springfox 57 | springfox-swagger-ui 58 | 2.9.2 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | org.springframework.boot 67 | spring-boot-maven-plugin 68 | 69 | 70 | 71 | org.projectlombok 72 | lombok 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /northwind/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect 2 | spring.jpa.hibernate.ddl-auto=update 3 | spring.jpa.hibernate.show-sql=true 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/Northwind 5 | spring.datasource.username=postgres 6 | spring.datasource.password=252018 7 | spring.jpa.properties.javax.persistence.validation.mode = none -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/NorthwindApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/NorthwindApplication.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/api/controllers/ProductsController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/api/controllers/ProductsController.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/business/abstracts/ProductService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/business/abstracts/ProductService.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/business/concretes/ProductManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/business/concretes/ProductManager.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/core/utilities/results/DataResult.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/core/utilities/results/DataResult.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/core/utilities/results/ErrorDataResult.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/core/utilities/results/ErrorDataResult.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/core/utilities/results/ErrorResult.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/core/utilities/results/ErrorResult.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/core/utilities/results/Result.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/core/utilities/results/Result.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/core/utilities/results/SuccessDataResult.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/core/utilities/results/SuccessDataResult.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/core/utilities/results/successResult.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/core/utilities/results/successResult.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/dataAccess/abstracts/ProductDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/dataAccess/abstracts/ProductDao.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/entities/concretes/Category.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/entities/concretes/Category.class -------------------------------------------------------------------------------- /northwind/target/classes/kodlamaio/northwind/entities/concretes/Product.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/classes/kodlamaio/northwind/entities/concretes/Product.class -------------------------------------------------------------------------------- /northwind/target/test-classes/kodlamaio/northwind/NorthwindApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkaraca25/JavaBootCamp/c421bdaec66d11ec6c093ec9f52ade227a7de1f8/northwind/target/test-classes/kodlamaio/northwind/NorthwindApplicationTests.class --------------------------------------------------------------------------------