dkharrat / nexusdata Goto Github PK
View Code? Open in Web Editor NEWCore Data for Android
License: Apache License 2.0
Core Data for Android
License: Apache License 2.0
Can you add support for double, float attribute type?
In iOS it is possible to modify managedObject like this:
mo.setValue(obj, forKey: "someAttribute")
Is it possible pass argument i.e. string and not class, pass argument without static type-check?
Or only by passing class as argument?
Task task1 = objCtx.newObject(Task.class);
http://stackoverflow.com/questions/40890602/get-dao-with-weak-typing-in-ormlite
Hello,
Today came across this api and its cool. To find coredata model structure for android.
I am sucessfull in building all projects and getting ToDo sample.
It running fine until I got db version updated from 3->4 where i changed some column name and added one new and remove one from old. And things worked fine, but i come across an issue of Data got lost.
Where in case of iOS their is no such case.
Also i am have started working over a UI plugin for handling db-strucure in somewhat similar way we have for iOS.
So my plan forth is to get a perspective ready for db modle like we have xdatamodel in iOS. We can create similar and in the UI editor we can provide a feature to create table entities and attributes. Also we can enhance it to handle Predicates too.
Thnx for helping such a realistic problem for android developer where core-data relation is to be handled manually by developers where we can maintain same in CoreData Model.
In Core Data context could have a parent context. Do you plan to implement it?
See this: https://www.cocoanetics.com/2012/07/multi-context-coredata/
Hey, Could you please add support for transformable datatype where we can store images?
First thanks for this project, it's awesome! So I was trying to figure the reason why you said the above in the Limitations list. From what I can tell the ManagedObjects registered from fetches are never unregistered, and their corresponding entry in the entityCache is never removed, thus the memory will never be freed for objects that are queried but not deleted. I would imagine that CoreData on the Mac makes use of reference counting to decide when it is suitable to release a ManagedObject from the cache. It likely monitors if any of the objects have a reference count of 1 and if so removes them from the context's object array, resulting in a release. I had a quick look at it seems Java doesn't have any mechanism to detect if an object is referenced by any other making this quite a challenging problem to solve elegantly. Since the feature is likely a long way off, as a work around in the mean time would you consider making a temporary method that both unregisters the object and also removes it from the entityCache? Perhaps make unregisterObject public then in ManagedObject setManagedObjectContext it could check if its null and if so it could get the cacheNode and remove it? My reason for this method would be although we don't have a way to track when the right time is to free an object, at least having the method to do it would be a good start.
Is it possible to get back ordered set
instead of set
in nexus data? Implement i.e. _User
class differently, than recently?
@SuppressWarnings("unchecked")
public Set<Task> getTasks() {
return (Set<Task>)getValue(Property.TASKS);
}
BTW do you now why is no "ordered" descriptor possible to set in model scheme?
Hello, i create predicate like this:
PredicateBuilder.parse("createDate != null")
.
I gets java.lang.NullPointerException at com.github.dkharrat.nexusdata.store.DatabaseQueryService$QueryBuilder.visit(PredicateToSQL.java:85) at com.github.dkharrat.nexusdata.store.DatabaseQueryService$QueryBuilder.visit(PredicateToSQL.java:166) at com.github.dkharrat.nexusdata.store.DatabaseQueryService$QueryBuilder.visit(PredicateToSQL.java:137) at com.github.dkharrat.nexusdata.store.DatabaseQueryService$QueryBuilder.visit(PredicateToSQL.java:156) at com.github.dkharrat.nexusdata.store.DatabaseQueryService$QueryBuilder.visit(PredicateToSQL.java:116) at com.github.dkharrat.nexusdata.store.DatabaseQueryService$QueryBuilder.visit(PredicateToSQL.java:154) at com.github.dkharrat.nexusdata.store.DatabaseQueryService.buildQuery(PredicateToSQL.java:62) at com.github.dkharrat.nexusdata.store.DatabaseQueryService.query(PredicateToSQL.java:41) at com.github.dkharrat.nexusdata.store.AndroidSqlPersistentStore.executeFetchRequest(AndroidSqlPersistentStore.java:85) at com.github.dkharrat.nexusdata.core.ObjectContext.executeFetchOperation(ObjectContext.java:120)
Could you add support for many to many relationships?
Hi!
In CoreData it is possible to set mergePolicy
.
context!.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
.
Sometimes upserting managedObjects is quite frequent and queriing by ID and upsetting mo would create two records. But NSMergeByPropertyObjectTrumpMergePolicy
prevent it. Is it possible somehow in nexus data?
I create a Predicate:
Predicate predicate = PredicateBuilder.parse("testId == 53c7eaf909c7d69602013c68");
and
System.out.println(predicate) return (testId EQUAL 53).
I have an ordinary FetchRequest
as tutorial write, but it does not return:
FetchRequest<Record> fetchRequest = c.newFetchRequestBuilder(Record.class)
.predicate("id == " + id)
.build();
List<Record> records = c.executeFetchOperation(fetchRequest);
id
is a string. Lines are executed from a serial queue. context was created on the same thread where call is now. Debugger does not reach c.executeFetchOperation
line. @dkharrat do you have any idea what is wrong?
NexusData does have SUBQUERY language element from Core Data, like this:
let fr2: NSFetchRequest<Item> = Item.fetchRequest()
fr2.predicate = NSPredicate(format: "SUBQUERY(ratings, $r, ($r.userSetting.id = %@ AND $r.scale > 0)).@count = 0 AND SUBQUERY(ratings, $r, ($r.userSetting.id != %@ AND $r.scale > 0)).@count > 0", loggedInUserID!, loggedInUserID!)
Where should I put in the following command on a Mac, in terminal? Gradle shuld be preinstalled on my Mac?
gradle :modelgen:run -Pargs="-f /path/to/model/todo.model.json -O /path/to/output/src/main/java"
I do not see gradle script in the project folder.
Kukodas-MacBook-Air:MovieBuffs3 kukodajanos$ ls
MovieBuffs3.iml gradle local.properties
app gradle.properties settings.gradle
build gradlew
build.gradle gradlew.bat
Kukodas-MacBook-Air:MovieBuffs3 kukodajanos$ gradle
-bash: gradle: command not found
Is Parent Entity
supported. Tried to set superEntityName
but it is not processed?!
"entities": [{
"name": "Record",
"attributes": [{
"name": "id",
"type": "String"
}]
}, {
"name": "Item",
"superEntityName" : "Record",
In ObjectModelJsonParser
there is a static class called Entity
. It has superEntity
field. Strange though from Json it does not read up value.
static class Entity {
String name;
@SerializedName("extends") String superEntityName;
List<Attribute> attributes;
List<Relationship> relationships;
List<EnumProperty> enums;
}
Am I right that predicate does not accept keypath, only key? i.e. will not work?
"item.id == "tt2707408" AND userSetting.id == "625345927616512""
demand != null && demand.satisfied == false && gender == "male"
I have the following predicate, and app crashes. Why?
I guess constants are OK, based on this:
lexerGrammar.add("(\"[^\"\\\\\\r\\n]*(?:\\\\.[^\"\\\\\\r\\n]*)*\")|\\d+|true|false|null", TokenType.CONSTANT);
comparators too:
lexerGrammar.add("\\(", TokenType.OPEN_PAREN);
lexerGrammar.add("\\)", TokenType.CLOSE_PAREN);
lexerGrammar.add("&&", TokenType.AND);
lexerGrammar.add("\\|\\|", TokenType.OR);
lexerGrammar.add("==", TokenType.EQUAL);
lexerGrammar.add("!=", TokenType.NOT_EQUAL);
lexerGrammar.add(">=", TokenType.GREATER_THAN_OR_EQUAL);
lexerGrammar.add("<=", TokenType.LESS_THAN_OR_EQUAL);
lexerGrammar.add(">", TokenType.GREATER_THAN);
lexerGrammar.add("<", TokenType.LESS_THAN);
lexerGrammar.add("(\"[^\"\\\\\\r\\n]*(?:\\\\.[^\"\\\\\\r\\n]*)*\")|\\d+|true|false|null", TokenType.CONSTANT);
lexerGrammar.add("[a-zA-Z][a-zA-Z0-9_]*", TokenType.FIELD_NAME);
I am a bit newbie in Android development. Have more experience in iOS development. Have a Mac and Android Studio. How can I 'Add the following dependency to your pom.xml file for your project:' ?I do not find pom.xml in my project I just created. Do I have to install first Maven? Or is it coming with Android Studio?
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.