Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f369a9a

Browse files
author
avinashverma
committed
Added Algo
1 parent 6a78df7 commit f369a9a

File tree

122 files changed

+780
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+780
-182
lines changed

‎pom.xml‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@
2020

2121

2222
<dependencies>
23-
<!--<dependency>-->
24-
<!--<groupId>org.springframework.boot</groupId>-->
25-
<!--<artifactId>spring-boot-starter-data-jpa</artifactId>-->
26-
<!--</dependency>-->
27-
28-
23+
<dependency>
24+
<groupId>org.springframework.boot</groupId>
25+
<artifactId>spring-boot-starter-data-jpa</artifactId>
26+
</dependency>
27+
<dependency>
28+
<groupId>mysql</groupId>
29+
<artifactId>mysql-connector-java</artifactId>
30+
<scope>runtime</scope>
31+
</dependency>
2932

3033
<!--<dependency>-->
3134
<!--<groupId>org.springframework.boot</groupId>-->
@@ -41,17 +44,17 @@
4144
<groupId>org.springframework.boot</groupId>
4245
<artifactId>spring-boot-starter-web</artifactId>
4346
</dependency>
47+
<!-- <dependency>-->
48+
<!-- <groupId>org.springframework.boot</groupId>-->
49+
<!-- <artifactId>spring-boot-starter-activemq</artifactId>-->
50+
<!-- </dependency>-->
4451

4552
<!--<dependency>-->
4653
<!--<groupId>org.springframework.boot</groupId>-->
4754
<!--<artifactId>spring-boot-devtools</artifactId>-->
4855
<!--<scope>runtime</scope>-->
4956
<!--</dependency>-->
50-
<dependency>
51-
<groupId>mysql</groupId>
52-
<artifactId>mysql-connector-java</artifactId>
53-
<scope>runtime</scope>
54-
</dependency>
57+
5558
<dependency>
5659
<groupId>org.projectlombok</groupId>
5760
<artifactId>lombok</artifactId>

‎src/main/java/com/example/demo/corejavademo/polymorphism/PolyMain.java‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎src/main/java/com/example/demo/devtoools/DevTools.java‎

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package com.example.demo.hibernates;
2+
3+
4+
import javax.persistence.*;
5+
import java.util.ArrayList;
6+
import java.util.List;
7+
8+
@Entity
9+
@Table(name = "department")
10+
public class Department {
11+
12+
13+
@Id
14+
@GeneratedValue(strategy = GenerationType.IDENTITY)
15+
private Long id;
16+
17+
18+
@Column(name="dept_name",length=100,nullable=false)
19+
private String deptName;
20+
21+
22+
23+
@OneToMany(mappedBy = "department",cascade = CascadeType.PERSIST)
24+
private List<Employee> employees=new ArrayList<>();
25+
26+
public Long getId() {
27+
return id;
28+
}
29+
30+
public void setId(Long id) {
31+
this.id = id;
32+
}
33+
34+
public String getDeptName() {
35+
return deptName;
36+
}
37+
38+
public void setDeptName(String deptName) {
39+
this.deptName = deptName;
40+
}
41+
42+
public List<Employee> getEmployees() {
43+
return employees;
44+
}
45+
46+
public void setEmployees(List<Employee> employees) {
47+
this.employees = employees;
48+
}
49+
50+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
package com.example.demo.hibernates;
2+
3+
import org.hibernate.annotations.NaturalId;
4+
5+
import javax.persistence.*;
6+
7+
@Entity
8+
@Table(name="employee")
9+
public class Employee {
10+
11+
12+
@Id
13+
@GeneratedValue(strategy = GenerationType.IDENTITY)
14+
@Column(name="id")
15+
private Long id;
16+
17+
@Column(name="employee_name",length=60)
18+
private String employeeName;
19+
20+
@NaturalId
21+
@Column(name="user_name",length=60,nullable=false)
22+
private String username;
23+
24+
@Column(name="password",nullable=false)
25+
private String password;
26+
27+
@Column(name="accress_level")
28+
private int accessLevel;
29+
30+
31+
@ManyToOne
32+
@JoinColumn(name="department_id")
33+
private Department department;
34+
35+
36+
37+
public Long getId() {
38+
return id;
39+
}
40+
41+
public void setId(Long id) {
42+
this.id = id;
43+
}
44+
45+
public String getEmployeeName() {
46+
return employeeName;
47+
}
48+
49+
public void setEmployeeName(String employeeName) {
50+
this.employeeName = employeeName;
51+
}
52+
53+
public String getUsername() {
54+
return username;
55+
}
56+
57+
public void setUsername(String username) {
58+
this.username = username;
59+
}
60+
61+
public String getPassword() {
62+
return password;
63+
}
64+
65+
public void setPassword(String password) {
66+
this.password = password;
67+
}
68+
69+
public void setAccessLevel(int accessLevel) {
70+
this.accessLevel = accessLevel;
71+
}
72+
73+
public int getAccessLevel() {
74+
return accessLevel;
75+
}
76+
77+
public Department getDepartment() {
78+
return department;
79+
}
80+
81+
public void setDepartment(Department department) {
82+
this.department = department;
83+
}
84+
}

‎src/main/java/com/example/demo/DemoApplication.java‎ renamed to ‎src/main/java/com/example/demo/java/DemoApplication.java‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
package com.example.demo;
1+
package com.example.demo.java;
22

3-
import com.example.demo.devtoools.DevConfig;
4-
import com.example.demo.qualifiers.FootbalGame;
5-
import com.example.demo.qualifiers.Game;
6-
import com.example.demo.qualifiers.Race;
3+
import com.example.demo.java.devtoools.DevConfig;
4+
import com.example.demo.java.qualifiers.Game;
75
import org.springframework.beans.factory.annotation.Autowired;
8-
import org.springframework.beans.factory.annotation.Qualifier;
96
import org.springframework.boot.SpringApplication;
107
import org.springframework.boot.autoconfigure.SpringBootApplication;
118
import org.springframework.scheduling.annotation.EnableAsync;
@@ -26,7 +23,7 @@ public class DemoApplication {
2623

2724
@Autowired
2825
// @Qualifier(value = "race")
29-
private Game game;
26+
// private Game game;
3027

3128
public static void main(String[] args) {
3229
SpringApplication.run(DemoApplication.class, args);
@@ -39,7 +36,7 @@ private void postConstruct() {
3936
System.out.println("PostConstruct called");
4037
// mailService.signUp();
4138

42-
game.start();
39+
// game.start();
4340

4441
// ((Race)game).goal();
4542
}

‎src/main/java/com/example/demo/DemoTest.java‎ renamed to ‎src/main/java/com/example/demo/java/DemoTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.demo;
1+
package com.example.demo.java;
22

33
import java.util.ArrayList;
44
import java.util.List;

‎src/main/java/com/example/demo/DispacherServlet.java‎ renamed to ‎src/main/java/com/example/demo/java/DispacherServlet.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.demo;
1+
package com.example.demo.java;
22

33
public class DispacherServlet {
44

‎src/main/java/com/example/demo/FixedScheduler1.java‎ renamed to ‎src/main/java/com/example/demo/java/FixedScheduler1.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.demo;
1+
package com.example.demo.java;
22

33
import org.springframework.scheduling.annotation.Scheduled;
44
import org.springframework.stereotype.Component;

‎src/main/java/com/example/demo/InitBlock.java‎ renamed to ‎src/main/java/com/example/demo/java/InitBlock.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.demo;
1+
package com.example.demo.java;
22

33
public class InitBlock {
44

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /