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 c3bd771

Browse files
Code sample - 23c SpringBoot JPA Hibernate UCP (#315)
* Code sample - 23c SpringBoot JPA Hibernate UCP * code sample adjustments * code sample adjustments * fixed indentation * adjusted to 23ai as requested * adjusted to the latest driver version (Nov 24) 23.6.0.24.10 as requested
1 parent 264ea1c commit c3bd771

File tree

11 files changed

+650
-0
lines changed

11 files changed

+650
-0
lines changed
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Java related
2+
target/
3+
*.jar
4+
*.war
5+
*.ear
6+
*.class
7+
8+
# Log file
9+
*.log
10+
11+
# Package Files
12+
*.jar
13+
*.war
14+
*.nar
15+
*.ear
16+
*.zip
17+
*.tar.gz
18+
*.rar
19+
20+
# JVM crash logs - http://www.java.com/en/download/help/error_hotspot.xml
21+
hs_err_pid*
22+
23+
# Eclipse.gitignore - https://github.com/github/gitignore/blob/main/Global/Eclipse.gitignore
24+
.metadata
25+
.classpath
26+
.project
27+
bin/
28+
tmp/
29+
*.tmp
30+
*.bak
31+
*.swp
32+
*~.nib
33+
local.properties
34+
.settings/
35+
.loadpath
36+
.recommenders
37+
38+
# External tool builders
39+
.externalToolBuilders/
40+
41+
# Locally stored "Eclipse launch configurations"
42+
*.launch
43+
44+
# PyDev specific (Python IDE for Eclipse)
45+
*.pydevproject
46+
47+
# CDT-specific (C/C++ Development Tooling)
48+
.cproject
49+
50+
# CDT- autotools
51+
.autotools
52+
53+
# Java annotation processor (APT)
54+
.factorypath
55+
56+
# PDT-specific (PHP Development Tools)
57+
.buildpath
58+
59+
# sbteclipse plugin
60+
.target
61+
62+
# Tern plugin
63+
.tern-project
64+
65+
# TeXlipse plugin
66+
.texlipse
67+
68+
# STS (Spring Tool Suite)
69+
.springBeans
70+
71+
# Code Recommenders
72+
.recommenders/
73+
74+
# Annotation Processing
75+
.apt_generated/
76+
.apt_generated_test/
77+
78+
# Scala IDE specific (Scala & Java development for Eclipse)
79+
.cache-main
80+
.scala_dependencies
81+
.worksheet
82+
83+
# Uncomment this line if you wish to ignore the project description file.
84+
# Typically, this file would be tracked if it contains build/dependency configurations:
85+
#.project
86+
87+
# External tool builders
88+
.externalToolBuilders/
89+
90+
# VS Code - https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
91+
.vscode/*
92+
!.vscode/settings.json
93+
!.vscode/tasks.json
94+
!.vscode/launch.json
95+
!.vscode/extensions.json
96+
!.vscode/*.code-snippets
97+
98+
# Local History for Visual Studio Code
99+
.history/
100+
101+
# Built Visual Studio Code Extensions
102+
*.vsix
103+
104+
# JetBrains .gitignore - https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
105+
# User-specific stuff
106+
.idea/**/workspace.xml
107+
.idea/**/tasks.xml
108+
.idea/**/usage.statistics.xml
109+
.idea/**/dictionaries
110+
.idea/**/shelf
111+
112+
# AWS User-specific
113+
.idea/**/aws.xml
114+
115+
# Generated files
116+
.idea/**/contentModel.xml
117+
118+
# Sensitive or high-churn files
119+
.idea/**/dataSources/
120+
.idea/**/dataSources.ids
121+
.idea/**/dataSources.local.xml
122+
.idea/**/sqlDataSources.xml
123+
.idea/**/dynamic.xml
124+
.idea/**/uiDesigner.xml
125+
.idea/**/dbnavigator.xml
126+
127+
# Gradle
128+
.idea/**/gradle.xml
129+
.idea/**/libraries
130+
131+
# Gradle and Maven with auto-import
132+
# When using Gradle or Maven with auto-import, you should exclude module files,
133+
# since they will be recreated, and may cause churn. Uncomment if using
134+
# auto-import.
135+
# .idea/artifacts
136+
# .idea/compiler.xml
137+
# .idea/jarRepositories.xml
138+
# .idea/modules.xml
139+
# .idea/*.iml
140+
# .idea/modules
141+
# *.iml
142+
# *.ipr
143+
144+
# CMake
145+
cmake-build-*/
146+
147+
# Mongo Explorer plugin
148+
.idea/**/mongoSettings.xml
149+
150+
# File-based project format
151+
*.iws
152+
153+
# IntelliJ
154+
out/
155+
156+
# mpeltonen/sbt-idea plugin
157+
.idea_modules/
158+
159+
# JIRA plugin
160+
atlassian-ide-plugin.xml
161+
162+
# Cursive Clojure plugin
163+
.idea/replstate.xml
164+
165+
# SonarLint plugin
166+
.idea/sonarlint/
167+
168+
# Crashlytics plugin (for Android Studio and IntelliJ)
169+
com_crashlytics_export_strings.xml
170+
crashlytics.properties
171+
crashlytics-build.properties
172+
fabric.properties
173+
174+
# Editor-based Rest Client
175+
.idea/httpRequests
176+
177+
# Android studio 3.1+ serialized cache file
178+
.idea/caches/build_file_checksums.ser

‎java/23ai-springboot3-jpa-ucp/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# 23c-springboot3-jpa-ucp
2+
[Java Persistence with Spring Boot 3, Spring Data JPA with Hibernate, and the Oracle Database 23c Free - Developer Release](https://rb.gy/i54khj)

‎java/23ai-springboot3-jpa-ucp/pom.xml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
6+
<modelVersion>4.0.0</modelVersion>
7+
8+
<parent>
9+
<groupId>org.springframework.boot</groupId>
10+
<artifactId>spring-boot-starter-parent</artifactId>
11+
<version>3.3.0</version>
12+
<relativePath /> <!-- lookup parent from repository -->
13+
</parent>
14+
15+
<groupId>com.oracle.dev.jdbc</groupId>
16+
<artifactId>23ai-springboot3-jpa-ucp</artifactId>
17+
<version>1.0-SNAPSHOT</version>
18+
<name>23ai-springboot3-jpa-ucp</name>
19+
<description>Java Persistence with Spring Boot 3, Spring Data JPA with
20+
Hibernate, and the Oracle Database 23ai Free</description>
21+
<url>
22+
https://juarezjunior.medium.com/java-persistence-with-spring-boot-3-spring-data-jpa-with-hibernate-and-the-oracle-database-23c-9c0946d4838f</url>
23+
<properties>
24+
<java.version>21</java.version>
25+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
26+
<maven.compiler.source>21</maven.compiler.source>
27+
<maven.compiler.target>21</maven.compiler.target>
28+
</properties>
29+
30+
<dependencies>
31+
<dependency>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-starter-data-jpa</artifactId>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-starter-web</artifactId>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.springframework.boot</groupId>
41+
<artifactId>spring-boot-starter-test</artifactId>
42+
<scope>test</scope>
43+
</dependency>
44+
<dependency>
45+
<groupId>com.oracle.database.jdbc</groupId>
46+
<artifactId>ojdbc11-production</artifactId>
47+
<version>23.6.0.24.10</version>
48+
<type>pom</type>
49+
</dependency>
50+
<!-- Metrics -->
51+
<dependency>
52+
<groupId>org.springframework.boot</groupId>
53+
<artifactId>spring-boot-starter-actuator</artifactId>
54+
</dependency>
55+
</dependencies>
56+
57+
<build>
58+
<plugins>
59+
<plugin>
60+
<groupId>org.hibernate.orm.tooling</groupId>
61+
<artifactId>hibernate-enhance-maven-plugin</artifactId>
62+
<version>${hibernate.version}</version>
63+
<executions>
64+
<execution>
65+
<id>enhance</id>
66+
<goals>
67+
<goal>enhance</goal>
68+
</goals>
69+
<configuration>
70+
<enableLazyInitialization>true</enableLazyInitialization>
71+
<enableDirtyTracking>true</enableDirtyTracking>
72+
<enableAssociationManagement>true</enableAssociationManagement>
73+
</configuration>
74+
</execution>
75+
</executions>
76+
</plugin>
77+
<plugin>
78+
<groupId>org.springframework.boot</groupId>
79+
<artifactId>spring-boot-maven-plugin</artifactId>
80+
</plugin>
81+
<plugin>
82+
<artifactId>maven-compiler-plugin</artifactId>
83+
<configuration>
84+
<compilerArgs>
85+
</compilerArgs>
86+
</configuration>
87+
</plugin>
88+
</plugins>
89+
</build>
90+
</project>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
CREATE USER ORACLE_23C_USER IDENTIFIED BY <YOUR_PASSWORD>;
2+
GRANT DB_DEVELOPER_ROLE TO ORACLE_23C_USER;
3+
GRANT CREATE SESSION TO ORACLE_23C_USER;
4+
GRANT UNLIMITED TABLESPACE TO ORACLE_23C_USER;
5+
6+
CREATE TABLE Employee
7+
(id NUMBER(10) CONSTRAINT pk_employee PRIMARY KEY,
8+
name VARCHAR2(20),
9+
job VARCHAR2(20),
10+
salary NUMBER(10),
11+
commission NUMBER(10));
12+
13+
INSERT INTO Employee VALUES(7369,'JOHN','CLERK',7902,NULL);
14+
INSERT INTO Employee VALUES(7499,'PETER','SALESMAN',7698,300);
15+
INSERT INTO Employee VALUES(7521,'JEFF','SALESMAN',7698,500);
16+
INSERT INTO Employee VALUES(7566,'MARK','MANAGER',7839,NULL);
17+
INSERT INTO Employee VALUES(7654,'MARTIN','SALESMAN',7698,1400);
18+
INSERT INTO Employee VALUES(7698,'ADAM','MANAGER',7839,NULL);
19+
INSERT INTO Employee VALUES(7782,'CLARK','MANAGER',7839,NULL);
20+
INSERT INTO Employee VALUES(7788,'SCOTT','ANALYST',7566,NULL);
21+
INSERT INTO Employee VALUES(7839,'KING','PRESIDENT',NULL);
22+
INSERT INTO Employee VALUES(7844,'TURNER','SALESMAN',0);
23+
INSERT INTO Employee VALUES(7876,'ADAMS','CLERK',7788,NULL);
24+
INSERT INTO Employee VALUES(7900,'JAMES','CLERK',7698,NULL);
25+
INSERT INTO Employee VALUES(7902,'FORD','ANALYST',7566,NULL);
26+
INSERT INTO Employee VALUES(7934,'MILLER','CLERK',7782,NULL);
27+
28+
COMMIT;
29+
30+
SELECT * FROM EMPLOYEE;

0 commit comments

Comments
(0)

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