openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hinshaw <>
Subject How to remove DISTINCT clause for @Persistent object getter
Date Wed, 18 Jan 2012 20:53:36 GMT

Sorry this problem is a little complex to explain but I will try to be as
verbose as possible. Any assistance would be very appreciated in solving
this issue. I am thinking that the problem is that the Persistent option on
the "RData value" in ReportExecutionOutput is creating me a OneToOne which
is adding the DISTTINCT clause but I am unsure on how to resolve this.

This is the query that I am running to retch an implementation of a
MappedSuperClass, the implementation of RDataStringVector_value is a
List<String> and the DISTINCT option is only returning
me the unique elements in the list.  

// Debug on query, notice the DISTINCT
SELECT DISTINCT, t4.element FROM ReportExecution t0 INNER JOIN
ReportExecution_ReportExecutionOutput t1 ON = t1.REPORTEXECUTION_ID
INNER JOIN ReportExecutionOutput t2 ON t1.OUTPUTS_ID = INNER JOIN
RDataStringVector t3 ON t2.outputValue = INNER JOIN
RDataStringVector_value t4 ON = t4.RDATASTRINGVECTOR_ID WHERE
t0.REPORT_ID = ? ORDER BY ASC [params=?]

* In this object I am trying to access the RData value which is a
MappedSuperClass that contain their own values such as a List<Double> or
List<String> .

public class ReportExecutionOutput extends DatastoreObject {
     * The output definition has more information about what to
     * do with the value associated.
    @OneToOne(cascade = CascadeType.ALL, fetch=FetchType.EAGER)
    private ReportOutputDefinition outputDefinition;
     * Value for the input.
    @Persistent(cascade = { CascadeType.PERSIST, CascadeType.MERGE,
    private RData<?> outputValue;


public abstract class RData<T> extends DatastoreObject {

    private String name;

    public RData() {

     * Constructor that takes
     * @param name
    public RData(String name) { = name;


@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class RDataVector<T> extends RData<List&lt;T>> {

    public RDataVector() {

    public RDataVector(String name) {

    public String toString() {
        String debugString = "";
        for (T d : getValue()) {
            debugString += "" + d;
        return debugString;

public class RDataStringVector extends RDataVector<String> {

    @PersistentCollection(elementCascade = CascadeType.ALL, fetch =
    private List<String> value;

    public RDataStringVector() {

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message