Skip to content

Commit

Permalink
L2cache and query cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Nareshit authored and Nareshit committed May 10, 2021
1 parent 938c4eb commit 4a5506b
Show file tree
Hide file tree
Showing 32 changed files with 749 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Thu Apr 29 09:13:13 IST 2021
#Mon May 10 09:09:34 IST 2021
m2e.projectLocation=C\:\\Users\\Nareshit\\git\\NTHB915\\HBProj77-OneToOneFK
m2e.projectName=HBProj77-OneToOneFK
groupId=nit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Thu Apr 29 09:13:17 IST 2021
#Mon May 10 09:09:35 IST 2021
m2e.projectLocation=C\:\\Users\\Nareshit\\git\\NTHB915\\HBProj78-OneToOnePK
m2e.projectName=HBProj78-OneToOnePK
groupId=nit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Thu Apr 29 09:13:18 IST 2021
#Mon May 10 09:09:36 IST 2021
m2e.projectLocation=C\:\\Users\\Nareshit\\git\\NTHB915\\HBProj86Anno-ManyToManyBi-CollectionId
m2e.projectName=HBProj86Anno-ManyToManyBi-CollectionId
groupId=nit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Thu Apr 29 09:13:19 IST 2021
#Mon May 10 09:09:36 IST 2021
m2e.projectLocation=C\:\\Users\\Nareshit\\git\\NTHB915\\HBProj87Anno-OneToOneFK
m2e.projectName=HBProj87Anno-OneToOneFK
groupId=nit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Generated by Maven Integration for Eclipse
#Thu Apr 29 09:13:26 IST 2021
m2e.projectLocation=G\:\\Worskpaces\\Hibernate\\NTHB915\\HBProj88Anno-OneToOnePK
#Mon May 10 09:09:37 IST 2021
m2e.projectLocation=C\:\\Users\\Nareshit\\git\\NTHB915\\HBProj88Anno-OneToOnePK
m2e.projectName=HBProj88Anno-OneToOnePK
groupId=nit
artifactId=HBProj75-ManyToManyBi
Expand Down
32 changes: 32 additions & 0 deletions HBProj90-L2Cache-EHCache-QueryCache/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src/main/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/java">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/resources">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-14/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
6 changes: 6 additions & 0 deletions HBProj90-L2Cache-EHCache-QueryCache/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf

5 changes: 5 additions & 0 deletions HBProj90-L2Cache-EHCache-QueryCache/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
23 changes: 23 additions & 0 deletions HBProj90-L2Cache-EHCache-QueryCache/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>HBProj90-L2Cache-EHCache-QueryCache</name>
<comment>Project HBProj49-HBFilters created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=
auto.sync=true
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=false
show.executions.view=false
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=14
org.eclipse.jdt.core.compiler.compliance=14
org.eclipse.jdt.core.compiler.source=14
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.jboss.ide.eclipse.as.core.singledeployable.deployableList=
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<ehcache>

<diskStore path="java.io.tmpdir"/>
<!--Default Cache configuration. These will applied to caches programmatically created through
the CacheManager.
The following attributes are required for defaultCache:
maxInMemory - Sets the maximum number of objects that will be created in memory
eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element
is never expired.
timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
if the element is not eternal. Idle time is now - last accessed time
timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
if the element is not eternal. TTL is now - creation time
overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
has reached the maxInMemory limit.
-->
<defaultCache
maxElementsInMemory="100"
eternal="false"
timeToIdleSeconds="10"
timeToLiveSeconds="30"
overflowToDisk="true"
/>

</ehcache>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Connection properties (mandatory except driver class name) -->
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:xe</property>
<property name="connection.username">system</property>
<property name="connection.password">manager</property>

<!-- <property name="connection.driver_class">com.mysql.cj.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql:///nthb915db</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
-->

<!-- Connection provider to work with Proxool -->
<property name="connection.provider_class">org.hibernate.hikaricp.internal.HikariCPConnectionProvider</property>

<!-- HikariCP settings -->
<property name="hikari.connectionTimeout">50000</property>
<property name="hibernate.hikari.minimumIdle">10</property>
<property name="hibernate.hikari.maximumPoolSize">20</property>
<property name="hibernate.hikari.idleTimeout">30000</property>


<!-- Hibernate properties (optional) -->
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="hbm2ddl.auto">update</property>
<property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
<!-- For each cache -->
<property name="cache.use_second_level_cache">true</property>
<property name="net.sf.ehcache.configurationResourceName">com/nt/cfgs/ehcache.xml</property>
<property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>
<property name="hibernate.cache.use_query_cache">true</property>
<!-- mapping classes -->
<mapping resource="com/nt/entity/BankAccount.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.nt.entity.BankAccount" table="BANKACCOUNT">
<id name="acno" type="long">
<generator class="increment"/>
</id>
<property name="holderName" type="string" length="20" not-null="true" />
<property name="balance" type="float" not-null="true"/>
<property name="status" type="string" length="20" />
</class>

</hibernate-mapping>


Binary file not shown.
Binary file not shown.
Binary file not shown.
38 changes: 38 additions & 0 deletions HBProj90-L2Cache-EHCache-QueryCache/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.3/userguide/java_library_plugin.html
*/

plugins {
// Apply the java-library plugin to add support for Java Library
id 'application'
}

sourceCompatibility='14.0.1'
targetCompatibility='14.0.1'


repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}

dependencies {
// https://mvnrepository.com/artifact/org.hibernate/hibernate-core
implementation group: 'org.hibernate', name: 'hibernate-core', version: '5.4.28.Final'
// https://mvnrepository.com/artifact/com.oracle.ojdbc/ojdbc8
implementation group: 'com.oracle.ojdbc', name: 'ojdbc8', version: '19.3.0.0'
// https://mvnrepository.com/artifact/org.projectlombok/lombok
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.18'
// https://mvnrepository.com/artifact/org.hibernate/hibernate-hikaricp
implementation group: 'org.hibernate', name: 'hibernate-hikaricp', version: '5.4.28.Final'

// https://mvnrepository.com/artifact/org.hibernate/hibernate-ehcache
implementation group: 'org.hibernate', name: 'hibernate-ehcache', version: '5.4.31.Final'


}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 4a5506b

Please sign in to comment.