Skip to main content

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

Hey.. i know that with hibernate we can instrument da class for LazyLoad of properties.

Im using something like:
<target name="Instrument">
<taskdef name="instrument" classname="org.hibernate.tool.instrument.cglib.InstrumentTask">
<classpath refid="project.classpath" />
</taskdef>

<instrument verbose="false">
<fileset dir="target/classes">
<include name="**/Profissional.class" />
<include name="**/ProfissionalAssinatura.class" />
</fileset>
</instrument>
</target>

and in my entity i need to use:

@Basic( fetch = FetchType.LAZY )
    public byte[] getBlAssinatura() {
        return this.blAssinatura;
    }

I wanna know if eclipseLink has something similar too ?



2010/2/25 Derek Knapp <derek@xxxxxxxxxxxxxx>
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
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top