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 so | |
import org.neo4j.ogm.annotation.GeneratedValue | |
import org.neo4j.ogm.annotation.Id | |
import org.neo4j.ogm.annotation.NodeEntity | |
import org.neo4j.ogm.annotation.Relationship | |
import org.neo4j.ogm.config.Configuration | |
import org.neo4j.ogm.session.SessionFactory | |
@NodeEntity |
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 ac.simons.neo4j.examples; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.util.List; | |
import java.util.Map; | |
import org.neo4j.configuration.connectors.BoltConnector; | |
import org.neo4j.configuration.helpers.SocketAddress; | |
import org.neo4j.dbms.api.DatabaseManagementServiceBuilder; |
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 demo; | |
import java.util.Map; | |
import java.util.stream.Collectors; | |
import org.neo4j.driver.Driver; | |
public record Movie(String id, String title) { | |
public static final class Repository { |
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
Moved to https://github.com/michael-simons/pv |
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
//usr/bin/env jbang "$0" "$@" ; exit $? | |
//JAVA 17 | |
//DEPS org.neo4j.driver:neo4j-java-driver:5.7.0 | |
//DEPS com.fasterxml.jackson.core:jackson-databind:2.14.1 | |
package ac.simons; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; |
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
/* | |
* Copyright 2020 Jens "Nigjo" Hofschröer. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
sqlite3 :memory: \ | |
'.mode csv' \ | |
'.import "|curl -s https://gist.githubusercontent.com/zhonglism/f146a9423e2c975de8d03c26451f841e/raw/f79e190df4225caed58bf360d8e20a9fa872b4ac/vgsales.csv" hlp' \ | |
" | |
WITH vgsales AS ( | |
SELECT name, cast(global_sales as number) * 1000000 AS sales, cast(year as number) AS year FROM hlp WHERE year != 'N/A' | |
), | |
per_year AS ( | |
SELECT year, name, sales, dense_rank() OVER (PARTITION BY year ORDER BY sales DESC) AS rnk FROM vgsales | |
) |
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 java.util.Map; | |
import org.jooq.Record; | |
import org.jooq.RecordMapper; | |
import org.jooq.RecordMapperProvider; | |
import org.jooq.RecordType; | |
import org.jooq.impl.DefaultRecordMapper; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.cache.annotation.Cacheable; | |
import org.springframework.core.ResolvableType; |
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
//usr/bin/env jbang "$0" "$@" ; exit $? | |
//JAVA 17+ | |
//DEPS com.google.googlejavaformat:google-java-format:1.15.0 | |
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED | |
import com.google.googlejavaformat.java.Main; |
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
plugins { | |
id 'org.springframework.boot' version '2.1.7.RELEASE' | |
id 'io.spring.dependency-management' version '1.0.8.RELEASE' | |
id 'java' | |
} | |
group = 'com.example' | |
version = '0.0.1-SNAPSHOT' | |
sourceCompatibility = '1.8' |
NewerOlder