Questions tagged [foreign-collection]

A collection of foreign keys associated with an entity used in Object Relational Mapping systems.

66 questions
179
votes
2 answers

PostgreSQL array of elements that each are a foreign key

I am attempting to create a DB for my app and one thing I'd like to find the best way of doing is creating a one-to-many relationship between my Users and Items tables. I know I can make a third table, ReviewedItems, and have the columns be a User…
Zach
  • 4,555
  • 9
  • 31
  • 52
29
votes
3 answers

Convert ForeignCollection to ArrayList - ORMLite, Gson and Android

I apologize if I'm not super clear with my explanation but I'll add to and edit this question for clarity if requested. I am developing an Android app which receives data through an external API and stores data locally using ORMLite. Prior to…
wuliwong
  • 4,238
  • 9
  • 41
  • 69
19
votes
2 answers

Deleting using ormlite on android?

I have a Client bean , @DatabaseField(columnName = "client_id",generatedId = true,useGetSet = true) private Integer clientId; @DatabaseField(columnName = "client_nom",useGetSet = true) private String clientNom; @DatabaseField(columnName =…
Majid
  • 199
  • 1
  • 1
  • 3
12
votes
2 answers

Create table with Foreign Collection Field

I have this abstract class: DomainItem abstract public class DomainItem { @DatabaseField(generatedId = true) protected long id; @ForeignCollectionField(eager = false) protected ForeignCollection contentItens; …
Munir
  • 739
  • 2
  • 14
  • 38
8
votes
1 answer

Collections in ORMLite

Hello I want persist some collections data with ORMlite in my android app. For example : class Person { @DatabaseField(generatedId=true) private int id; @DatabaseField private String name; @DatabaseField private String surname; …
Bandzio
  • 617
  • 2
  • 10
  • 21
8
votes
2 answers

eloquent filter result based on foreign table attribute

I'm using laravel and eloquent. Actually I have problems filtering results from a table based on conditions on another table's attributes. I have 3 tables: venue city here are the relationships: a city has many locations and a location…
Mehrdad Shokri
  • 1,974
  • 2
  • 29
  • 45
7
votes
0 answers

Parsing with jackson and inserting same object to sqlite using ormlite android

I am parsing json data using Jackson from api call and trying to insert the data in sqlite using ormlite. For this i am using same model class. Here is my model classes public class Site { @DatabaseField(generatedId=true,columnName="ID") private…
rawcoder064
  • 1,374
  • 3
  • 11
  • 26
6
votes
1 answer

ORMLite many to many relation Android

I have two classes : UniteStratigraphique.java : @DatabaseTable(tableName = "unitestratigraphique") public class UniteStratigraphique { public final static String ID_FIELD_NAME = "id"; @DatabaseField(generatedId = true,…
eento
  • 761
  • 4
  • 20
  • 53
5
votes
2 answers

Problems with ORMLite and lazy collections

I am using ormlite in my android project. I have two classes @DatabaseTable(tableName = "usershows") public class UserShow { @DatabaseField(id = true) private Integer showId; @ForeignCollectionField(eager = false) private…
Georgy Gobozov
  • 13,633
  • 8
  • 72
  • 78
4
votes
1 answer

ORMLite initialize foreign collection

I have foreign collection field on my Object. If I create Object > save it > query for it : then I have it and can use it. But if I create Object and try to access foreign collection field right away then it's null. How can I initialize it?
somerandomusername
  • 1,993
  • 4
  • 23
  • 55
4
votes
1 answer

Using a ForeignCollection

My entity contains the following private ForeignCollection attribute: @ForeignCollectionField private ForeignCollection orderCollection; private List orderList; What is the best way or usual way to avoid a having a caller use a…
MayoMan
  • 4,757
  • 10
  • 53
  • 85
4
votes
1 answer

Adding, removing objects from a ForeignCollection

I have an entity that contains a ForeignCollection with a getter & setter for the Collection public class TextQuestion{ @ForeignCollectionField private ForeignCollection answers; .... I have a Servicer wrapper class that…
MayoMan
  • 4,757
  • 10
  • 53
  • 85
4
votes
1 answer

Using ForeignCollections in SQLite

I want to write a unit test that basically verifies an object I add to a foreign collection actually gets saved and retrieved correctly when the DAO saves retrieves the object Here is my Entity. @DatabaseTable public class Question implements…
MayoMan
  • 4,757
  • 10
  • 53
  • 85
3
votes
1 answer

ORMLite ForeignCollection: Must use ClosableIterator?

quick question about using ORMLite. I am trying to make sure that my implementation is correct. There's a part of the documentation that talks about closableIterators and how accessing this loads the LazyForeignCollection class and it needs to be…
dineth
  • 9,822
  • 6
  • 32
  • 39
3
votes
1 answer

Could not build lazy iterator for class of foreign collection member

I have a simple master-detail, when I query for de master and inspect for the foreign member collection, throw an exception java.lang.IllegalStateException: Could not build lazy iterator for class com.example.entity.detail List masters =…
Zach dev
  • 1,610
  • 8
  • 15
1
2 3 4 5