Skip to content

Commit 0fb7223

Browse files
author
Burak O�UZ
committed
first commit
0 parents  commit 0fb7223

File tree

119 files changed

+4042
-0
lines changed

Some content is hidden

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

119 files changed

+4042
-0
lines changed

hibernate/.classpath

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
4+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
5+
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
6+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
7+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
8+
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
9+
<classpathentry kind="output" path="target/classes"/>
10+
</classpath>

hibernate/.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>hiberante</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.maven.ide.eclipse.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.maven.ide.eclipse.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#Tue Dec 22 18:02:41 EET 2009
2+
eclipse.preferences.version=1
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
4+
org.eclipse.jdt.core.compiler.compliance=1.4
5+
org.eclipse.jdt.core.compiler.source=1.3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#Tue Dec 22 18:02:41 EET 2009
2+
activeProfiles=
3+
eclipse.preferences.version=1
4+
fullBuildGoals=process-test-resources
5+
includeModules=false
6+
resolveWorkspaceProjects=true
7+
resourceFilterGoals=process-resources resources\:testResources
8+
skipCompilerPlugin=true
9+
version=1

hibernate/pom.xml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.deneme</groupId>
6+
<artifactId>hibernate</artifactId>
7+
<version>0.0.1-SNAPSHOT</version>
8+
9+
<dependencies>
10+
11+
<dependency>
12+
<groupId>junit</groupId>
13+
<artifactId>junit</artifactId>
14+
<version>3.8.1</version>
15+
<scope>test</scope>
16+
</dependency>
17+
18+
<!-- MySQL database driver -->
19+
<dependency>
20+
<groupId>mysql</groupId>
21+
<artifactId>mysql-connector-java</artifactId>
22+
<version>5.1.9</version>
23+
</dependency>
24+
25+
<!-- Hibernate framework -->
26+
<dependency>
27+
<groupId>org.hibernate</groupId>
28+
<artifactId>hibernate</artifactId>
29+
<version>3.1.3</version>
30+
</dependency>
31+
32+
33+
<!-- Hibernate library dependecy start -->
34+
<dependency>
35+
<groupId>dom4j</groupId>
36+
<artifactId>dom4j</artifactId>
37+
<version>1.6.1</version>
38+
</dependency>
39+
40+
<dependency>
41+
<groupId>commons-logging</groupId>
42+
<artifactId>commons-logging</artifactId>
43+
<version>1.1.1</version>
44+
</dependency>
45+
46+
<dependency>
47+
<groupId>commons-collections</groupId>
48+
<artifactId>commons-collections</artifactId>
49+
<version>3.2.1</version>
50+
</dependency>
51+
52+
<dependency>
53+
<groupId>cglib</groupId>
54+
<artifactId>cglib</artifactId>
55+
<version>2.2</version>
56+
</dependency>
57+
58+
<dependency>
59+
<groupId>javax.transaction</groupId>
60+
<artifactId>jta</artifactId>
61+
<version>1.0.1b</version>
62+
<scope>compile</scope>
63+
</dependency>
64+
<!-- Hibernate library dependecy end -->
65+
66+
</dependencies>
67+
68+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.deneme.hibernate;
2+
3+
import org.hibernate.SessionFactory;
4+
import org.hibernate.cfg.Configuration;
5+
6+
public class HibernateUtil {
7+
8+
private static final SessionFactory sessionFactory = buildSessionFactory();
9+
10+
private static SessionFactory buildSessionFactory() {
11+
try {
12+
// Create the SessionFactory from hibernate.cfg.xml
13+
return new Configuration().configure().buildSessionFactory();
14+
}
15+
catch (Throwable ex) {
16+
// Make sure you log the exception, as it might be swallowed
17+
System.err.println("Initial SessionFactory creation failed." + ex);
18+
throw new ExceptionInInitializerError(ex);
19+
}
20+
}
21+
22+
public static SessionFactory getSessionFactory() {
23+
return sessionFactory;
24+
}
25+
26+
public static void shutdown() {
27+
// Close caches and connection pools
28+
getSessionFactory().close();
29+
}
30+
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package com.deneme.hibernate;
2+
3+
/**
4+
* Model class for Stock
5+
*/
6+
public class Stock implements java.io.Serializable {
7+
8+
private static final long serialVersionUID = 1L;
9+
10+
private Integer stockId;
11+
private String stockCode;
12+
private String stockName;
13+
14+
public Stock() {
15+
}
16+
17+
public Stock(String stockCode, String stockName) {
18+
this.stockCode = stockCode;
19+
this.stockName = stockName;
20+
}
21+
22+
public Integer getStockId() {
23+
return this.stockId;
24+
}
25+
26+
public void setStockId(Integer stockId) {
27+
this.stockId = stockId;
28+
}
29+
30+
public String getStockCode() {
31+
return this.stockCode;
32+
}
33+
34+
public void setStockCode(String stockCode) {
35+
this.stockCode = stockCode;
36+
}
37+
38+
public String getStockName() {
39+
return this.stockName;
40+
}
41+
42+
public void setStockName(String stockName) {
43+
this.stockName = stockName;
44+
}
45+
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.deneme.hibernate;
2+
3+
import org.hibernate.Session;
4+
5+
public class Uygulama
6+
{
7+
public static void main( String[] args )
8+
{
9+
System.out.println("Maven + Hibernate + MySQL");
10+
Session session = HibernateUtil.getSessionFactory().openSession();
11+
12+
session.beginTransaction();
13+
Stock stock = new Stock();
14+
15+
stock.setStockCode("4715");
16+
stock.setStockName("GENM");
17+
18+
session.save(stock);
19+
session.getTransaction().commit();
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
3+
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
4+
5+
<hibernate-mapping>
6+
<class name="com.deneme.hibernate.Stock" table="stock" catalog="hibernate_example">
7+
<id name="stockId" type="java.lang.Integer">
8+
<column name="STOCK_ID" />
9+
<generator class="identity" />
10+
</id>
11+
<property name="stockCode" type="string">
12+
<column name="STOCK_CODE" length="10" not-null="true" unique="true" />
13+
</property>
14+
<property name="stockName" type="string">
15+
<column name="STOCK_NAME" length="20" not-null="true" unique="true" />
16+
</property>
17+
</class>
18+
</hibernate-mapping>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
3+
<hibernate-configuration>
4+
<session-factory>
5+
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
6+
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
7+
<property name="hibernate.connection.password"></property>
8+
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/hibernate_example</property>
9+
<property name="hibernate.connection.username">root</property>
10+
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
11+
<property name="show_sql">true</property>
12+
<mapping resource="com/deneme/hibernate/Stock.hbm.xml"></mapping>
13+
</session-factory>
14+
</hibernate-configuration>

spring-aop/.classpath

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
4+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
5+
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
6+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
7+
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
8+
<classpathentry kind="output" path="target/classes"/>
9+
</classpath>

spring-aop/.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>ornek3</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.maven.ide.eclipse.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.maven.ide.eclipse.maven2Nature</nature>
21+
<nature>org.eclipse.jdt.core.javanature</nature>
22+
</natures>
23+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Fri Dec 25 00:14:54 EET 2009
2+
eclipse.preferences.version=1
3+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.5
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.source=1.5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#Fri Dec 25 00:12:08 EET 2009
2+
activeProfiles=
3+
eclipse.preferences.version=1
4+
fullBuildGoals=process-test-resources
5+
includeModules=false
6+
resolveWorkspaceProjects=true
7+
resourceFilterGoals=process-resources resources\:testResources
8+
skipCompilerPlugin=true
9+
version=1

spring-aop/pom.xml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>org.cevahir.spring</groupId>
5+
<artifactId>ornek3</artifactId>
6+
<packaging>jar</packaging>
7+
<version>1.0-SNAPSHOT</version>
8+
<name>ornek3</name>
9+
<url>http://maven.apache.org</url>
10+
<dependencies>
11+
12+
<dependency>
13+
<groupId>junit</groupId>
14+
<artifactId>junit</artifactId>
15+
<version>3.8.1</version>
16+
<scope>test</scope>
17+
</dependency>
18+
19+
<dependency>
20+
<groupId>org.springframework</groupId>
21+
<artifactId>spring</artifactId>
22+
<version>2.5.6</version>
23+
</dependency>
24+
25+
<dependency>
26+
<groupId>org.springframework</groupId>
27+
<artifactId>spring-aop</artifactId>
28+
<version>2.5.6</version>
29+
</dependency>
30+
31+
<dependency>
32+
<groupId>org.springframework</groupId>
33+
<artifactId>spring-aspects</artifactId>
34+
<version>2.5.6</version>
35+
</dependency>
36+
37+
38+
<dependency>
39+
<groupId>org.springframework</groupId>
40+
<artifactId>spring-context</artifactId>
41+
<version>2.5.6</version>
42+
</dependency>
43+
44+
<dependency>
45+
<groupId>org.aspectj</groupId>
46+
<artifactId>aspectjweaver</artifactId>
47+
<version>1.6.2</version>
48+
</dependency>
49+
50+
<dependency>
51+
<groupId>org.aspectj</groupId>
52+
<artifactId>aspectjrt</artifactId>
53+
<version>1.6.2</version>
54+
</dependency>
55+
56+
</dependencies>
57+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package org.cevahir.spring;
2+
3+
import org.springframework.context.ApplicationContext;
4+
import org.springframework.context.support.ClassPathXmlApplicationContext;
5+
6+
/**
7+
* Hello world!
8+
*
9+
*/
10+
public class App
11+
{
12+
public static void main( String[] args )
13+
{
14+
ApplicationContext applicationContext =
15+
new ClassPathXmlApplicationContext("/orkestra.xml");
16+
17+
MaystroServisi maystroServisi =
18+
(MaystroServisi) applicationContext.getBean("maystro");
19+
20+
maystroServisi.yonet();
21+
}
22+
}

0 commit comments

Comments
 (0)