Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] select part of an entity

I have a table, which I run a very simple select on, for example,

    select e from Email e where e.createDate between :start and :end

but the problem is that the Email has a column "body" which contains a lot of data, and I really don't need that information right now.... is there a way to make it not select that column?

the only solution I can think of is to create a new class with the fields I want from the Email entity, then do something like

select new itrac.data.EmailReport(e.id, e.name, e.subject, ...) from Email e where e.createDate between :start and :end

but is there a better way??


Derek


Back to the top