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
Ravi Teja Gudapati
@tejainece
CodiciIVA should declare a BelongsTo annotation
on the foreignkey field
Massimo Caroccia
@carmas123
how I can do that
Ravi Teja Gudapati
@tejainece
which is foreign key in CodiciIVA?
Massimo Caroccia
@carmas123
but the foreignkey is on Articoli
Ravi Teja Gudapati
@tejainece
which is the foreignkey in Articoli?
Massimo Caroccia
@carmas123
codiceIVA
Ravi Teja Gudapati
@tejainece
it is not string. How can it be foreignkey?
I mean all primary keys in your example are strings
Massimo Caroccia
@carmas123
Well then I do not understand
Yes are string
then I need to create "String codiceIVA"
Ravi Teja Gudapati
@tejainece
yes
Massimo Caroccia
@carmas123
ok this is good
Ravi Teja Gudapati
@tejainece
and you have to annotate codiceIVA with BelongsTo
not HasOne
Massimo Caroccia
@carmas123
buy when I use the class Articoli how can I access to "percentuale" fileld of CodiciIVA ??
Ravi Teja Gudapati
@tejainece
hmm
Massimo Caroccia
@carmas123
this is my problem
Ravi Teja Gudapati
@tejainece
You can access Articoli from CodiciIVA
Not the other way round
parent always has reference to child
Massimo Caroccia
@carmas123
mmm
Massimo Caroccia
@carmas123
sorry ravi...
my table Articoli have a field "codiceIVA" linked to table "CodiciIVA.codice"
ok
Ravi Teja Gudapati
@tejainece
Try this
Massimo Caroccia
@carmas123
now when I use the class Articoli I need to have all data of CodiciIVA from Articoli
and not viceversa
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 codiceIVA;
}
@GenBean()
class CodiciIVABean extends Bean<CodiciIVA> with _CodiciIVABean {
  CodiciIVABean(Adapter adapter)
      : addressBean = ArticoliBean(adapter),
        super(adapter);

  final ArticoliBean addressBean;

  String get tableName => 'CodiciIVA';
}

@GenBean()
class Articoli Bean extends Bean<Articoli> with _Articoli Bean {
  CodiciIVABean _codiciIVABean;
 CodiciIVABean get codiciIVABean => _codiciIVABean ??= CodiciIVABean(adapter);

  Articoli Bean(Adapter adapter) : super(adapter);

  String get tableName => 'Articoli';
}
Massimo Caroccia
@carmas123
ok I try it
Exception: Foreign key in foreign model not found!
Ravi Teja Gudapati
@tejainece
Try @BelongsTo(CodiciIVABean, refCol: 'codice')
refCol defaults to id. In your case, the reference column is codice in the other table
Did it work?
Massimo Caroccia
@carmas123
ok now the generation work fin
fine
only one problem now
to access to CodiciIVA.percentuale from Articoli class?
Sorry only a question
when I work with Jaguar orm I need to handle the Bean class or model class
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