This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I have been programming Java since 1996 at both the application and systems level. | |
// This seemingly elementary problem that I would fail on any junior-level interview | |
// gave me absolute fits. I wanted to capture it here for the benefit of other | |
// dullards like me. You are not alone. | |
// | |
// Suppose you have some number of arrays (let's say 2). Like so: | |
// | |
// final Object[] o0 = new Object[] { String.class, Number.class }; | |
// final Object[] o1 = new Object[] { Object.class }; | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.bytebuddy.description.modifier.Visibility; | |
import net.bytebuddy.dynamic.DynamicType; | |
import net.bytebuddy.implementation.FieldAccessor; | |
import net.bytebuddy.implementation.MethodCall; | |
import static net.bytebuddy.implementation.MethodCall.invoke; | |
import static net.bytebuddy.matcher.ElementMatchers.named; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.level=INFO | |
handlers=io.helidon.common.HelidonConsoleHandler | |
java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n | |
com.zaxxer.hikari.level=INFO | |
h2database.level=WARNING | |
io.netty.level=INFO | |
org.eclipse.persistence.level=FINE | |
org.glassfish.jersey.server.level=CONFIG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@PersistenceContext | |
private EntityManager em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Dependent | |
public class ExampleResource { | |
// rest of class follows | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.enterprise.context.Dependent; | |
import javax.persistence.EntityManager; | |
import javax.persistence.PersistenceContext; | |
import javax.transaction.Transactional; | |
import javax.ws.rs.PathParam; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>com.ethlo.persistence.tools</groupId> | |
<artifactId>eclipselink-maven-plugin</artifactId> | |
<version>2.7.1.1</version> | |
<dependencies> | |
<dependency> | |
<groupId>javax.annotation</groupId> | |
<artifactId>javax.annotation-api</artifactId> | |
<version>1.3.1</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.helidon.example.jpa; | |
import java.io.Serializable; | |
import java.util.Objects; | |
import javax.persistence.Access; | |
import javax.persistence.AccessType; | |
import javax.persistence.Basic; | |
import javax.persistence.Column; | |
import javax.persistence.Entity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence version="2.2" | |
xmlns="http://xmlns.jcp.org/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence | |
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"> | |
<persistence-unit name="greeting" transaction-type="JTA"> | |
<description>A persistence unit for the greeting example.</description> | |
<jta-data-source>greetingDataSource</jta-data-source> | |
<class>io.helidon.example.jpa.Greeting</class> |
NewerOlder