eugene-kamenev / orientdb-groovy Goto Github PK
View Code? Open in Web Editor NEWOrientDB groovy mapper for documents and graphs
License: MIT License
OrientDB groovy mapper for documents and graphs
License: MIT License
Person.count()
Person.list()
You can also add needed methods in comments that could be useful.
Ferma lib is here: https://github.com/Syncleus/Ferma
Some discussion with Ferma contributor goes here:
https://groups.google.com/a/syncleus.com/forum/#!topic/ferma-list/NfWMIAzbfEQ
12:40:05.119 [DEBUG] [TestEventLogger] com.ek.orient.graph.OrientGraphTransformationTest > test that transformations applied right STANDARD_ERROR
12:40:05.120 [DEBUG] [TestEventLogger] lug 29, 2015 12:40:05 PM com.orientechnologies.common.log.OLogManager log
12:40:05.120 [DEBUG] [TestEventLogger] AVVERTENZA: {db=tests} Requested command 'Committing the active transaction to create the new type 'Person' as subclass of 'V'. The transaction will be reopen right after that. To avoid this behavior create the classes outside the transaction' must be executed outside active transaction: the transaction will be committed and reopen right after it. To avoid this behavior execute it outside a transaction
12:40:05.162 [QUIET] [system.out] 12:40:05.158 [INFO] [org.gradle.api.internal.tasks.testing.worker.TestWorker] Gradle Test Executor 1 finished executing tests.
12:40:05.165 [QUIET] [system.out] 12:40:05.165 [DEBUG] [org.gradle.process.internal.child.ActionExecutionWorker] Completed Gradle Test Executor 1.
12:40:05.210 [DEBUG] [TestEventLogger]
12:40:05.211 [DEBUG] [TestEventLogger] com.ek.orient.graph.OrientGraphTransformationTest > test that transformations applied right FAILED
12:40:05.211 [DEBUG] [TestEventLogger] groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: firstName for class: com.ek.orient.graph.Person
12:40:05.225 [DEBUG] [TestEventLogger] at com.ek.orient.graph.OrientGraphTransformationTest.test that transformations applied right(OrientGraphTransformationTest.groovy:35)
12:40:05.227 [DEBUG] [TestEventLogger]
12:40:05.227 [DEBUG] [TestEventLogger] com.ek.orient.graph.OrientGraphTransformationTest FAILED
12:40:05.227 [DEBUG] [TestEventLogger]
12:40:05.228 [DEBUG] [TestEventLogger] Gradle Test Executor 1 FAILED
Readonly properties?!?
With GORM v3.0 we can write native GORM implementation for orientdb, future work will be posted here: grails-data-mapping
Something like this one:
class Person {
String id
List<City> visitedCities
static mapping = {
visitedCities(formula: "select expand(out('Visited')) from Person where @rid=?", params: [id])
}
}
You can post your ideas about how you want this feature could be implemented.
example:
class Article {
String title
static mapping = {
title(index: 'lucene', analyzer: 'org.apache.lucene.analysis.en.EnglishAnalyzer') // or StandartAnalyzer by default
}
}
Sorry for a very clueless issue, but I'm starting a project using OrientDB and I'd like to use Grails for my web front-end. Can you point me to any documentation that would get me started using your datastore extension? I looked at the Neo4J one, but they have a "plugin" and I don't know how (or even if I can) use the raw datastore extension without a plugin.
Hello!
We really want to use this mapping library, but we are running into all sorts of issues.
First, the build sometimes fails when running the command gradle clean build test
, just after cloning.
Example:
Run 1:
➜ orientdb-groovy git:(master) gradle clean; gradle build; gradle test
BUILD SUCCESSFUL in 690ms
1 actionable task: 1 executed
> Task :compileTestGroovy
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/joaorocha/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.4.15/423a17aeb2f64bc6f76e8e44265a548bec80fd42/groovy-all-2.4.15.jar) to method java.util.AbstractCollection.hugeCapacity(int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
> Task :test
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/joaorocha/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.4.15/423a17aeb2f64bc6f76e8e44265a548bec80fd42/groovy-all-2.4.15.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
BUILD SUCCESSFUL in 10s
8 actionable tasks: 8 executed
BUILD SUCCESSFUL in 731ms
5 actionable tasks: 5 up-to-date
build 2 (right after build 1):
➜ orientdb-groovy git:(master) gradle clean build test
> Task :compileGroovy
startup failed:
/Users/joaorocha/Desktop/orientdb-groovy/src/main/groovy/com/github/eugene/kamenev/orient/graph/OrientGraphHelper.groovy: 175: [Static type checking] - Cannot find matching method java.lang.Object#countClass(java.lang.String). Please check if the declared type is right and if the method exists.
@ line 175, column 16.
return OrientGraph.activeGraph.rawGraph.countClass(className)
^
/Users/joaorocha/Desktop/orientdb-groovy/src/main/groovy/com/github/eugene/kamenev/orient/graph/OrientGraphHelper.groovy: 187: [Static type checking] - Cannot find matching method java.lang.Object#browseClass(java.lang.String). Please check if the declared type is right and if the method exists.
@ line 187, column 37.
return new GraphIterator<T>(OrientGraph.activeGraph.rawGraph.browseClass(className), clazz)
^
/Users/joaorocha/Desktop/orientdb-groovy/src/main/groovy/com/github/eugene/kamenev/orient/graph/OrientGraphHelper.groovy: 187: [Static type checking] - Cannot find matching method com.github.eugene.kamenev.orient.graph.GraphIterator#<init>(java.lang.Object, java.lang.Class). Please check if the declared type is right and if the method exists.
@ line 187, column 16.
return new GraphIterator<T>(OrientGraph.activeGraph.rawGraph.browseClass(className), clazz)
^
3 errors
> Task :compileGroovy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileGroovy'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
3 actionable tasks: 3 executed
Output of gradle -v
:
➜ orientdb-groovy git:(master) gradle -v
------------------------------------------------------------
Gradle 5.6.2
------------------------------------------------------------
Build time: 2019-09-05 16:13:54 UTC
Revision: 55a5e53d855db8fc7b0e494412fc624051a8e781
Kotlin: 1.3.41
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM: 11.0.2 (Oracle Corporation 11.0.2+9)
OS: Mac OS X 10.15 x86_64
Any ideas?
Thanks!
how about support for index creation?
Hey, love the library! thanks for the great work.
I have a question, what's the best way of embedding an object into a vertex. I'm trying the following:
@OrientDocument
@CompileStatic
@EqualsAndHashCode
class Point {
double latitude
double longitude
}
@Vertex
@CompileStatic
class MyVertex {
String name
Point location
static mapping = {
location(type: OType.EMBEDDED)
}
}
But I'm getting this exception when trying to create assign the location
property with a new instance of Point
:
MyVertex v = new MyVertex(
name: theName,
location: new Point(latitude: theLatitude, longitude: theLongitude)
)
groovy.lang.MissingPropertyException: No such property: vertex for class: Point
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:87)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetPropertySafe(AbstractCallSite.java:410)
at com.github.eugene.kamenev.orient.graph.OrientGraphHelper.getVertexFromEntity(OrientGraphHelper.groovy:58)
We can trigger fetching eager when entity object is wrapped
class Person {
String id
City city
static mapping = {
city(type: OType.LINK, fetch: 'eager')
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.