Skip to content

Instantly share code, notes, and snippets.

public final class com.nikoskatsanos.enums.Weekdays extends java.lang.Enum<com.nikoskatsanos.enums.Weekdays> {
public static final com.nikoskatsanos.enums.Weekdays MONDAY;
public static final com.nikoskatsanos.enums.Weekdays TUESDAY;
public static final com.nikoskatsanos.enums.Weekdays WEDNESDAY;
public static final com.nikoskatsanos.enums.Weekdays THURSDAY;
public static final com.nikoskatsanos.enums.Weekdays FRIDAY;
public static com.nikoskatsanos.enums.Weekdays[] values();
public static com.nikoskatsanos.enums.Weekdays valueOf(java.lang.String);
static {};
}
@nikkatsa
nikkatsa / HibernateToolsExampleRunner.java
Created June 1, 2016 21:21
ibernateToolsExampleRunner
public class HibernateToolsExampleRunner {
private static final com.nikoskatsanos.nkjutils.yalf.YalfLogger log = com.nikoskatsanos.nkjutils.yalf.YalfLogger.getLogger(HibernateToolsExampleRunner.class);
private static final String PACKAGE_NAME = "com.nikoskatsanos.entities";
public static void main(final String... args) throws ClassNotFoundException, SQLException, ExecutionException, InterruptedException {
log.info("**** Generating entity classes ****");
ExecutorService dbRunnerDaemon = null;
InMemoryDBRunner dbRunner = null;
@nikkatsa
nikkatsa / Address.java
Created June 1, 2016 21:24
JPA Entity POJOS
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
/**
* Address generated by hbm2java
@nikkatsa
nikkatsa / partial_pom.xml
Created June 1, 2016 21:27
Hibernate Tools Maven Generation
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<target name="GenerateJPAEntities">
<taskdef name="hibernatetool"
jshell> /help intro
|
| intro
|
| The jshell tool allows you to execute Java code, getting immediate results.
| You can enter a Java definition (variable, method, class, etc), like: int x = 8
| or a Java expression, like: x + x
| or a Java statement or import.
| These little chunks of Java code are called 'snippets'.
|
jshell> /h
/help /history
jshell> Sy
SyncFailedException SynchronousQueue System
jshell> /imports
| import java.util.*
| import java.io.*
| import java.math.*
| import java.net.*
| import java.util.concurrent.*
| import java.util.prefs.*
| import java.util.regex.*
jshell> import java.nio.Buffer
jshell> /classpath /tmp/*
| Path '/tmp/*' added to classpath
jshell>
jshell> System.out.println( "Hello JShell!!!" )
Hello JShell!!!
jshell> new File( "/tmp" )
$3 ==> /tmp
jshell> $3.exists()
$4 ==> true
jshell>
jshell> public int divideBy2( final int num ) {
...> return num >> 1;
...> }
| modified method divideBy2(int)
jshell> divideBy2( 6 )
$4 ==> 3
jshell> public class SimplePojo {
...> private String str;