tobby48 vor 6 Jahren
Ursprung
Commit
7d3ed615bf

+ 13
- 1
pom.xml Datei anzeigen

@@ -205,7 +205,8 @@
205 205
 		<dependency>
206 206
 			<groupId>org.scala-lang</groupId>
207 207
 			<artifactId>scala-library</artifactId>
208
-			<version>2.12.7</version>
208
+			<!-- <version>2.12.7</version> -->
209
+			<version>2.11.8</version>
209 210
 		</dependency>
210 211
 		
211 212
 		<dependency>
@@ -214,6 +215,17 @@
214 215
 			<version>63.1</version>
215 216
 		</dependency>
216 217
 
218
+	    <dependency>
219
+	        <groupId>org.bitbucket.eunjeon</groupId>
220
+			<artifactId>seunjeon_2.11</artifactId>
221
+	        <version>1.2.0</version>
222
+	    </dependency>
223
+	    <!-- <dependency>
224
+		    <groupId>com.jsuereth</groupId>
225
+		    <artifactId>sbt-pgp</artifactId>
226
+		    <version>1.1.0</version>
227
+		</dependency> -->
228
+	    
217 229
 		<dependency>
218 230
 			<groupId>com.sparkjava</groupId>
219 231
 			<artifactId>spark-core</artifactId>

+ 19
- 0
src/main/java/kr/co/swh/lecture/opensource/eunjeon/EunjeonAnalysis.java Datei anzeigen

@@ -0,0 +1,19 @@
1
+package kr.co.swh.lecture.opensource.eunjeon;
2
+
3
+import org.bitbucket.eunjeon.seunjeon.Analyzer;
4
+import org.bitbucket.eunjeon.seunjeon.LNode;
5
+import org.bitbucket.eunjeon.seunjeon.Morpheme;
6
+
7
+public class EunjeonAnalysis {
8
+
9
+	public static void main(String[] args) {
10
+		// TODO Auto-generated method stub
11
+		// 형태소 분석
12
+		for (LNode node : Analyzer.parseJava("아버지가방에들어가신다.")) {
13
+			Morpheme m = node.morpheme();
14
+			System.out.println(m.surface() + " / 품사:" + m.feature().head());
15
+		}
16
+
17
+	}
18
+
19
+}

+ 66
- 66
src/main/java/kr/co/swh/lecture/opensource/hibernate/annotation/Person.java Datei anzeigen

@@ -1,67 +1,67 @@
1
-package kr.co.swh.lecture.opensource.hibernate.annotation;
2
-
3
-import javax.persistence.*;
4
-
5
-/**
6
- * <pre>
7
- * kr.co.swh.lecture.opensource.hibernate.annotation
8
- * Person.java
9
- *
10
- * 설명 : 하이버네이트 어노테이션 예제2
11
- * </pre>
12
- * 
13
- * @since : 2017. 10. 26.
14
- * @author : tobby48
15
- * @version : v1.0
16
- */
17
-@Entity
18
-@Table(name = "PERSON")
19
-public class Person {
20
-   @Id
21
-   @Column(name = "id")
22
-   @GeneratedValue(strategy = GenerationType.IDENTITY)
23
-   private int id;
24
-
25
-   @Column(name = "first_name")
26
-   private String firstName;
27
-
28
-   @Column(name = "last_name")
29
-   private String lastName;
30
-
31
-   @Column(name = "salary")
32
-   private int salary;  
33
-
34
-   public Person() {}
35
-   
36
-   public int getId() {
37
-      return id;
38
-   }
39
-   
40
-   public void setId( int id ) {
41
-      this.id = id;
42
-   }
43
-   
44
-   public String getFirstName() {
45
-      return firstName;
46
-   }
47
-   
48
-   public void setFirstName( String first_name ) {
49
-      this.firstName = first_name;
50
-   }
51
-   
52
-   public String getLastName() {
53
-      return lastName;
54
-   }
55
-   
56
-   public void setLastName( String last_name ) {
57
-      this.lastName = last_name;
58
-   }
59
-   
60
-   public int getSalary() {
61
-      return salary;
62
-   }
63
-   
64
-   public void setSalary( int salary ) {
65
-      this.salary = salary;
66
-   }
1
+package kr.co.swh.lecture.opensource.hibernate.annotation;
2
+
3
+import javax.persistence.*;
4
+
5
+/**
6
+ * <pre>
7
+ * kr.co.swh.lecture.opensource.hibernate.annotation
8
+ * Person.java
9
+ *
10
+ * 설명 : 하이버네이트 어노테이션 예제2
11
+ * </pre>
12
+ * 
13
+ * @since : 2017. 10. 26.
14
+ * @author : tobby48
15
+ * @version : v1.0
16
+ */
17
+@Entity
18
+@Table(name = "PERSON")
19
+public class Person {
20
+   @Id
21
+   @Column(name = "id")
22
+   @GeneratedValue(strategy = GenerationType.IDENTITY)
23
+   private int id;
24
+
25
+   @Column(name = "first_name")
26
+   private String firstName;
27
+
28
+   @Column(name = "last_name", columnDefinition = "TEXT")
29
+   private String lastName;
30
+
31
+   @Column(name = "salary")
32
+   private int salary;  
33
+
34
+   public Person() {}
35
+   
36
+   public int getId() {
37
+      return id;
38
+   }
39
+   
40
+   public void setId( int id ) {
41
+      this.id = id;
42
+   }
43
+   
44
+   public String getFirstName() {
45
+      return firstName;
46
+   }
47
+   
48
+   public void setFirstName( String first_name ) {
49
+      this.firstName = first_name;
50
+   }
51
+   
52
+   public String getLastName() {
53
+      return lastName;
54
+   }
55
+   
56
+   public void setLastName( String last_name ) {
57
+      this.lastName = last_name;
58
+   }
59
+   
60
+   public int getSalary() {
61
+      return salary;
62
+   }
63
+   
64
+   public void setSalary( int salary ) {
65
+      this.salary = salary;
66
+   }
67 67
 }

+ 16
- 14
src/main/resources/hibernate-annotation.cfg.xml Datei anzeigen

@@ -1,14 +1,16 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
3
-                                         "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
4
-<hibernate-configuration>
5
-	<session-factory name="">
6
-		<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
7
-		<property name="hibernate.connection.password">tokki1127</property>
8
-		<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/annotation</property>
9
-		<property name="hibernate.connection.username">root</property>
10
-		<property name="hibernate.dialect">org.hibernate.dialect.MariaDB53Dialect</property>
11
-		<property name="hibernate.current_session_context_class">thread</property>
12
-		<property name="hibernate.show_sql">true</property>
13
-	</session-factory>
14
-</hibernate-configuration>
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
3
+                                         "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
4
+<hibernate-configuration>
5
+	<session-factory name="">
6
+		<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
7
+		<property name="hibernate.connection.password">swhacademy!</property>
8
+		<property name="hibernate.connection.url">jdbc:mysql://dev-swh.ga:3306/annotation</property>
9
+		<property name="hibernate.connection.username">root</property>
10
+		<property name="hibernate.dialect">org.hibernate.dialect.MariaDB53Dialect</property>
11
+		<property name="hibernate.current_session_context_class">thread</property>
12
+		
13
+		<property name="hibernate.hbm2ddl.auto">create</property>
14
+		<property name="hibernate.show_sql">true</property>
15
+	</session-factory>
16
+</hibernate-configuration>