Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] FetchGroups with a transient attribute

What you want to do is map your usersName and point it at the stored procedure. Take a look at this example to get you started:

http://wiki.eclipse.org/EclipseLink/Examples/JPA/CRUDStoredProcedures

On 03/07/2012 3:33 PM, Cozart, Michele L wrote:
My stored function does the concatenation of fields depending on the formatType sent it (firstNameFirst, lastNameFirst or Initials).

What you're saying is that I need to do the concatenation in Java instead.

Thanks for you help.

-----Original Message-----
From: eclipselink-users-bounces@xxxxxxxxxxx [mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Tom Ware
Sent: Tuesday, July 03, 2012 3:29 PM
To: eclipselink-users@xxxxxxxxxxx
Subject: Re: [eclipselink-users] FetchGroups with a transient attribute

If usersName is composed of the values of other attributes and not mapped, why is it in the fetch group at all.  Just put the attributes that compose it in the fetch group.  When that fetch group is fetched, you'll be able to compose that attribute.

There is no way for EclipseLink to know how usersName is composed, so it can't deal with it in the fetch group.

-Tom

On 03/07/2012 2:12 PM, Cozart, Michele L wrote:
I'm trying to retrieve a cursor that returns a fetch group where one
of the attributes is transient. I get the error message:

Attribute usersName of FetchGroup(usersName){usersName, userId} is not mapped.
The transient field is usersName which is a concatenation of lastname,
firstname etc. from the users table.

Here's what I have:

@Entity

@Table(name = "USERS")

@FetchGroup(name="usersName", attributes={

@FetchAttribute(name="userId"),

@FetchAttribute(name="usersName")})

@Transient

private String usersName; // getters and setters used

How do I do this?

Thanks,

Michele



_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top