BAEL-3091: The Prototype Pattern in Java (changed code based on valid comments from a reader)

This commit is contained in:
Vivek Balasubramaniam
2019-10-29 22:27:15 +05:30
parent db85c8f275
commit d3d5b060e7
20517 changed files with 1642290 additions and 0 deletions
@@ -0,0 +1,8 @@
drop table if exists allergens;
drop table if exists meal;
create table meal (id bigint auto_increment, name varchar(255) not null, description varchar(255) not null, price decimal(19, 2) not null, primary key (id));
create table allergens (meal_id bigint auto_increment, peanuts number(1) not null, celery number(1) not null, sesame_seeds number(1) not null, primary key (meal_id));
insert into meal (id, name, description, price) values (1, 'Pizza', 'Delicious', 5);
insert into allergens (meal_id, peanuts, celery, sesame_seeds) values (1, 0, 1, 0);
@@ -0,0 +1,5 @@
create table Product (id bigint not null, category varchar(255), description varchar(255), name varchar(255), unitPrice decimal(19,2), primary key (id));
insert into product(id, name, description, category) values (1,'Product Name 1','This is Product 1', 'category1');
insert into product(id, name, description, category) values (2,'Product Name 2','This is Product 2', 'category1');
insert into product(id, name, description, category) values (3,'Product Name 3','This is Product 3', 'category2');
insert into product(id, name, description, category) values (4,'Product Name 4','This is Product 4', 'category3');
@@ -0,0 +1,2 @@
INSERT INTO employees (employee_number, employee_name, employee_age) VALUES ('111', 'John Doe', 55);
INSERT INTO employees (employee_number, employee_name, employee_age) VALUES ('A123', 'John Doe Junior', 25);
@@ -0,0 +1,4 @@
INSERT INTO users(id,name) VALUES(1,'baeldung');
INSERT INTO users(id,name) VALUES(2,'john doe');
INSERT INTO users(id,name) VALUES(3,'jane doe');
INSERT INTO users(id,name) VALUES(4,'batman');