Questions tagged [apache-cayenne]

Apache Cayenne is an open source persistence framework, providing object-relational mapping (ORM) and remoting services.

Cayenne seamlessly binds one or more database schemas directly to Java objects, managing

  • atomic commit and rollbacks
  • SQL generation
  • joins
  • sequences

and more. With Cayenne's Remote Object Persistence, those Java objects can even be persisted out to clients via Web Services.

Full details and documentation can be found at http://cayenne.apache.org

132 questions
0
votes
1 answer

How to create custom SQLite function and execute under Cayenne

I'm trying to write a custom SQLite function that takes two args and run with Apache Cayenne's performQuery() which looks something like: String query = "SELECT * FROM TABLE WHERE MYFUNC(arg1, arg2) <= SOME_VALUE" ObjectContext ctx =…
jeemar
  • 548
  • 5
  • 15
0
votes
1 answer

Apache Cayenne Get Collection Expression

Using Apache Cayenne I am trying to figure out how to avoid doing iterative calls to the DB when I have a Collection of attribute values. Say we have a persistent object Person with an attribute name of type String. If I have a List containing names…
tarka
  • 5,289
  • 10
  • 51
  • 75
0
votes
1 answer

Data lost during SelectQuery

Example: s I've got an object a of the class A in relationship with objects b, c and d. If I do: SelectQuery query = new…
Adrien
  • 7
  • 5
0
votes
1 answer

Deleted collection still exist

I'm trying to delete a collection of objects, but somehow they still remain. List assignments = shift.getAssignments(); shift.getObjectContext().deleteObjects(assignments); shift.getObjectContext().commitChanges(); After commitChanges…
Tuan
  • 1,476
  • 13
  • 23
0
votes
1 answer

Prefetchs with Cayenne

I've got an object of the class A in 2 ways relationships with objects of classes B, C and D. So I could do (with "a" an object of type A): B b = a.getB(); A a1 = a.getB().getA(); // and a1 would be equal to a When I do a SelectQuery on A with…
Adrien
  • 7
  • 5
0
votes
1 answer

Cayenne with multiple nodes

I'm trying to set up a server with Cayenne (Remote Object Persistence). In my case I have several databases using the same map. What is the best way to implement that as two nodes cannot point to the same map? I found two ways to do that but that…
Adrien
  • 7
  • 5
0
votes
1 answer

Cayenne - Search for combination of dependencies

I'm creating an application that allows users to create a form, which can then be loaded and filled out by another user, and that user's submission can then be viewed. A Form is filled with Fields. When a user fills the form, a Submission database…
brent_aof
  • 141
  • 3
  • 12
0
votes
1 answer

Updating an object via Apache Cayenne

I've spent two hours with yo'll ole google and not having success. I'm using Apache Maven with mysql and Java EE (with a Restlet front). I'm trying to grab an object given it's ID attribute, then update it and save back to the database. I've seen…
acrawly
  • 443
  • 1
  • 6
  • 10
0
votes
1 answer

Apache Cayenne performQuery result List cast

I am using 3.0 Apache Cayenne, how can I ommit @SuppressWarnings("unchecked") in Eclipse for such simple code: public List getSomes() { SelectQuery select = new SelectQuery(Some.class); List somes =…
0
votes
0 answers

Foreign Key constraint fails Fails - Apache Cayenne

My database uses the following SQL, which has been comprised using apache cayenne. SET FOREIGN_KEY_CHECKS=0; DROP TABLE IF EXISTS Element CASCADE; SET FOREIGN_KEY_CHECKS=1; SET FOREIGN_KEY_CHECKS=0; DROP TABLE IF EXISTS Project CASCADE; SET…
Tom Hadkiss
  • 267
  • 1
  • 7
  • 16
0
votes
1 answer

Apache Cayenne Modeler modeling single table inheritance generated subclass with different return type

Using this as an example: https://cayenne.apache.org/docs/3.0/modeling-single-table-inheritance.html. I have an ObjEntity called Book. I have changed the Java Type for one of the attribute to use JodaTime's DateTime class. The superclass _Book()…
Tuan
  • 1,476
  • 13
  • 23
0
votes
1 answer

Cayenne Query Expression -- Need clarification

In the Apache Cayenne documentation, they provide an example of how to create a parameterized query using the Expression class' fromString() function: // create a qualifier with two named parameters: "pname" and "aname" Expression qual =…
Factor Three
  • 2,094
  • 5
  • 35
  • 51
0
votes
1 answer

Apache Cayenne 1-M relationship within same table

I am building a system that allows elements or landing spaces to be dragged onto other landing spaces. As such the model will be a tree of landing spaces with elements at the leaf. I wish to use apache cayenne to store this data. An ideal situation…
Tom Hadkiss
  • 267
  • 1
  • 7
  • 16
0
votes
1 answer

apache cayenne add weight on many to many relationship

everyone. I use apache cayenne on my project. got an issue can't work out. I have a engineer table and a skill table, An engineer can have many skill and A skill can belong to many engineer, so it's a many to many relationship. I made a…
Hetfield Joe
  • 1,443
  • 5
  • 15
  • 26
0
votes
1 answer

Cayenne JOIN expression

I've been trying to do a join query with cayenne but I'm getting stuck with the use of Expressions and that. In sql it would be something like this: SELECT * FROM usuarios, rol, user_rol WHERE usuarios.cod_usuario = user_rol.cod_usuario AND…
Vanessa
  • 51
  • 7
1 2 3
8
9