Re: Fetching data from a model
Re: Fetching data from a model
- Subject: Re: Fetching data from a model
- From: Theodore Petrosky <email@hidden>
- Date: Sun, 1 Oct 2017 18:35:24 -0400
André
what are you trying to do? What do you Entities look like?
Did you install and are you using the Wonder frameworks?
Ted
> On Oct 1, 2017, at 3:55 PM, André Rothe <email@hidden> wrote:
>
> Hi,
>
> I created a model with EOModeler. There are some classes in my project which
> represent the entities of my model. Now I come to the point, that I must
> fetch data from the database. In my Main component I created an EOQualifier
> which combines 4 attributes:
>
> EOQualifier eq = new EOAndQualifier(new NSArray<EOQualifier>(new
> EOQualifier[] {
> EOQualifier.qualifierWithQualifierFormat(MyEntity.A_KEY + "=%s",
> new NSArray<Object>(new Object[] { getSession().getA() })),
> EOQualifier.qualifierWithQualifierFormat(MyEntity.B_KEY + "=%s",
> new NSArray<Object>(new Object[] { getSession().getB() })),
> EOQualifier.qualifierWithQualifierFormat(MyEntity.C_KEY + "=%s",
> new NSArray<Object>(new Object[] { getSession().getC() })),
> EOQualifier.qualifierWithQualifierFormat(MyEntity.D_KEY + "<=?",
> new NSArray<Object>(new Object[] {new NSTimestamp() }))
> }));
>
> The D_KEY attribute is a timestamp, how I can define the format for such a
> column? In
> https://wiki.wocommunity.org/download/attachments/1049043/EnterpriseObjects.pdf
> I did not find any information about Timestamp attributes. Is that the right
> way to fetch data from the database? I would use the Qualifier with:
>
> EOEditingContext ec = getSession().defaultEditingContext();
> NSArray res = ec.objectsWithFetchSpecification(new
> EOFetchSpecification(StXSession.ENTITY_NAME, eq, null));
>
>
> Best regards
> Andre
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden