Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 03 2017 20:53
    tejainece opened #101
  • Jun 03 2017 20:52
    tejainece closed #100
  • Jun 03 2017 20:41
    tejainece synchronize #100
  • Jun 03 2017 20:15
    tejainece opened #100
  • Jun 03 2017 19:46

    tejainece on master

    Merge pull request #25 from Jag… Jaguar 0.5.x primary changes Big step towards 0.5.0 and 1 more (compare)

  • Jun 03 2017 19:46
    tejainece closed #99
  • Jun 03 2017 18:18
    tejainece opened #99
  • Mar 09 2017 18:38
    tejainece closed #98
  • Mar 09 2017 18:38
    tejainece commented #98
  • Mar 04 2017 08:39
    tejainece opened #98
  • Mar 03 2017 15:43
    tejainece closed #95
  • Mar 03 2017 15:43
    tejainece commented #95
  • Feb 28 2017 17:00
    lejard-h assigned #97
  • Feb 28 2017 17:00
    lejard-h assigned #96
  • Feb 28 2017 17:00
    lejard-h opened #97
  • Feb 28 2017 17:00
    lejard-h opened #96
  • Feb 28 2017 16:58
    lejard-h closed #90
  • Feb 28 2017 16:58
    lejard-h commented #90
  • Feb 27 2017 21:39

    Kleak on master

    Version bump Merge pull request #24 from Jag… Added glob route matching witho… and 2 more (compare)

  • Feb 27 2017 21:39
    Kleak closed #92
Massimo Caroccia
@carmas123
for example
if I have a list of product
Ravi Teja Gudapati
@tejainece
all the database stuff you use bean
Massimo Caroccia
@carmas123
ok but when I need to fetch a list of items
the bean return the model class
Ravi Teja Gudapati
@tejainece
final codiciIVA = await articoliBean.findByUser(articoli.id);
codiciIVA.percentuale;
yes
the bean talks to database
I will implement a way to preload parent from child
in your case, with current jaguar, i would do
articoli.codiciIVA = await articoliBean.findByUser(articoli.id);
articoli.codiciIVA.percentuale;
Massimo Caroccia
@carmas123
oh yes this is really good
but not really functional
Ravi Teja Gudapati
@tejainece
yes i agree
What do you mean functional?
Massimo Caroccia
@carmas123
because I need call an await method to read the values
Ravi Teja Gudapati
@tejainece
ok
Massimo Caroccia
@carmas123
the parent values are not available when the model class is created
Ravi Teja Gudapati
@tejainece
I will implement preloading parents for child model
Massimo Caroccia
@carmas123
this is a really good new :)
Kevin Segaud
@Kleak
asyncMap can help you to transform it no ?
Ravi Teja Gudapati
@tejainece
yes
Massimo Caroccia
@carmas123
news
Ravi Teja Gudapati
@tejainece
yes one could do with async map and then for lists and ones
Massimo Caroccia
@carmas123
yes this is true the best way in my opinion is to have in child class the reference with parent class that lazy load the parent class
Ravi Teja Gudapati
@tejainece
@carmas123 PRs are welcome. i will implement this. It will take some time
basically you will be able to do
Kevin Segaud
@Kleak
  Observable.fromFuture(getArticoli).asyncMap((articoli) async {
    articoli.codiciIVA = await articoliBean.findByUser(articoli.id);
    return articoli;
  }).listen((value) => print(value));
Ravi Teja Gudapati
@tejainece
or something like that
Massimo Caroccia
@carmas123
yes
Ravi Teja Gudapati
@tejainece
class CodiciIVA extends BaseModel {
  @PrimaryKey()
  String codice = "";
  String descrizione = "";
  num percentuale = 0;
  int noImponibile = 0;

  @HasOne(ArticoliBean)
  Articoli articoli;
}


class Articoli extends BaseModel {
  @PrimaryKey()
  String codice = "";
  @BelongsTo(CodiciIVABean, refCol: 'codice')
  String codiceIVAId;

  @Parent()
  CodiciIVA codiciIVA;
}
Massimo Caroccia
@carmas123
kevin you solution is good .... but when we work with an ORM we must have the best way to solve the problem and not an adaptive solution . ;)
Ravi Teja Gudapati
@tejainece
Thanks for the inputs @carmas123.
Massimo Caroccia
@carmas123
however for now I can use your solution
you are welcome
Revi...
sorry I don't know how the annotation generation work in dart...but the real best way is this:
class CodiciIVA extends BaseModel {
@PrimaryKey()
String codice = "";
String descrizione = "";
num percentuale = 0;
int noImponibile = 0;
}

class Articoli extends BaseModel {
@PrimaryKey()
String codice = "";

@Parent(refCol: "codice")
CodiciIVA codiciIVA;
}

this is a very good result
Ravi Teja Gudapati
@tejainece
You have to specify the foreign key.
Yes. I agree with your solution.
Only thing missing is foreign key in articoli
Massimo Caroccia
@carmas123
yes the foreignkey is needed only if we want to generate the table automatically
otherwise not
if we start the app with a pre-build database we dont need to specify the foreign key
or not?
Ravi Teja Gudapati
@tejainece
Jaguar assumes table creation
Massimo Caroccia
@carmas123
yes this is true
but it should not be mandatory