ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kenan Dalley <kenan.dal...@gm.com>
Subject Re: Ignite with Cassandra questions / errors
Date Thu, 05 Jan 2017 13:44:59 GMT
That really wouldn't be the cause.  I didn't actually include the full bean
class implementations in the initial post in order to save space, but they
are actual fully-realized beans.

Here are their actual implementations.


==================================
import org.apache.ignite.cache.affinity.AffinityKeyMapped;
import org.apache.ignite.cache.query.annotations.QuerySqlField;

public class HistoryResultKey {
	@AffinityKeyMapped
	@QuerySqlField(index=true, groups={"historyResultPK"})
	private String vin;

	@QuerySqlField(index=true, groups={"historyResultPK"}, name="session_id")
	private String sessionId;
    
	@QuerySqlField(index=true, groups={"historyResultPK"}, name="hist_name")
	private String histName;

    public HistoryResultKey() {
        // No op.
    }

    public HistoryResultKey(final String vin, final String sessionId, final
String histName) {
        this.vin = vin;
        this.sessionId = sessionId;
        this.histName= histName;
    }

    public String getVin() {
        return vin;
    }

    public void setVin(String vin) {
        this.vin = vin;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getHistName() {
        return histName;
    }

    public void setHistName(String histName) {
        this.histName= histName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;

        if (!(o instanceof HistoryResultKey))
            return false;

        HistoryResultKey that = (HistoryResultKey)o;

        if (vin != null ? !vin.equals(that.vin) : that.vin != null)
            return false;

        if (sessionId != null ? !sessionId.equals(that.sessionId) :
that.sessionId != null)
            return false;

        if (histName!= null ? !histName.equals(that.histName) :
that.histName!= null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int res = vin != null ? vin.hashCode() : 0;
        res = 31 * res + (sessionId != null ? sessionId.hashCode() : 0);
        res = 31 * res + (histName!= null ? histName.hashCode() : 0);
        return res;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("HistoryResultKey = [");
        sb.append("vin: ");
        sb.append(vin);
        sb.append(", sessionId: ");
        sb.append(sessionId);
        sb.append(", histName: ");
        sb.append(histName);
        sb.append("]");
        return sb.toString();
    }
}


===========================
import java.util.Date;

import org.apache.ignite.cache.query.annotations.QuerySqlField;
import org.apache.ignite.cache.query.annotations.QueryTextField;

public class HistoryResult {
	@QuerySqlField
    private String vin;

	@QuerySqlField(name="session_id")
	private String sessionId;

	@QuerySqlField(name="session_time")
	private Date sessionTime;

	@QuerySqlField(name="hist_name")
    private String histName;

	@QueryTextField
    private String results;

	@QuerySqlField(name="analysis_time")
    private Date analysisTime;

	@QuerySqlField(name="created_dt")
    private Date createdDate;

	@QuerySqlField(name="created_by")
    private String createdBy;

	@QuerySqlField(name="modified_dt")
    private Date modifiedDate;

	@QuerySqlField(name="modified_by")
    private String modifiedBy;

    public HistoryResult() {
        // no op
    }

    public HistoryResult(final String vin, final String sessionId, final
Date sessionTime,
                        final String histName, final String results, final
Date analysisTime,
                        final Date createdDate, final String createdBy,
final Date modifiedDate,
                        final String modifiedBy) {
    	this.vin = vin;
        this.sessionId = sessionId;
        this.sessionTime = sessionTime;
        this.histName= histName;
        this.results = results;
        this.analysisTime = analysisTime;
        this.createdDate = createdDate;
        this.createdBy = createdBy;
        this.modifiedDate = modifiedDate;
        this.modifiedBy = modifiedBy;
    }

	public String getVin() {
        return vin;
    }

    public void setVin(String vin) {
        this.vin = vin;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public Date getSessionTime() {
        return sessionTime;
    }

    public void setSessionTime(Date sessionTime) {
        this.sessionTime = sessionTime;
    }

    public String getHistName() {
        return histName;
    }

    public void setHistName(String histName) {
        this.histName= histName;
    }

    public String getResults() {
        return results;
    }

    public void setResults(String results) {
        this.results = results;
    }

    public Date getAnalysisTime() {
        return analysisTime;
    }

    public void setAnalysisTime(Date analysisTime) {
        this.analysisTime = analysisTime;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Date getModifiedDate() {
        return modifiedDate;
    }

    public void setModifiedDate(Date modifiedDate) {
        this.modifiedDate = modifiedDate;
    }

    public String getModifiedBy() {
        return modifiedBy;
    }

    public void setModifiedBy(String modifiedBy) {
        this.modifiedBy = modifiedBy;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;

        if (o == null)
        	return false;

        if (!(o instanceof HistoryResult))
            return false;

        HistoryResult that = (HistoryResult)o;

        if (vin != null ? !vin.equals(that.vin) : that.vin != null)
            return false;

        if (sessionId != null ? !sessionId.equals(that.sessionId) :
that.sessionId != null)
            return false;

        if (sessionTime != null ? !sessionTime.equals(that.sessionTime) :
that.sessionTime != null)
            return false;

        if (histName!= null ? !histName.equals(that.histName) :
that.histName!= null)
            return false;

        if (results != null ? !results.equals(that.results) : that.results
!= null)
            return false;

        if (analysisTime != null ? !analysisTime.equals(that.analysisTime) :
that.analysisTime != null)
            return false;

        if (createdDate != null ? !createdDate.equals(that.createdDate) :
that.createdDate != null)
            return false;

        if (createdBy != null ? !createdBy.equals(that.createdBy) :
that.createdBy != null)
            return false;

        if (modifiedDate != null ? !modifiedDate.equals(that.modifiedDate) :
that.modifiedDate != null)
            return false;

        if (modifiedBy != null ? !modifiedBy.equals(that.modifiedBy) :
that.modifiedBy != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int res = vin != null ? vin.hashCode() : 0;
        res = 31 * res + (sessionId != null ? sessionId.hashCode() : 0);
        res = 31 * res + (sessionTime != null ? sessionTime.hashCode() : 0);
        res = 31 * res + (histName!= null ? histName.hashCode() : 0);
        res = 31 * res + (results != null ? results.hashCode() : 0);
        res = 31 * res + (analysisTime != null ? analysisTime.hashCode() :
0);
        res = 31 * res + (createdDate != null ? createdDate.hashCode() : 0);
        res = 31 * res + (createdBy != null ? createdBy.hashCode() : 0);
        res = 31 * res + (modifiedDate != null ? modifiedDate.hashCode() :
0);
        res = 31 * res + (modifiedBy != null ? modifiedBy.hashCode() : 0);
        return res;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("HistoryResult = [");
        sb.append("vin: ");
        sb.append(vin);
        sb.append(", sessionId: ");
        sb.append(sessionId);
        sb.append(", sessionTime: ");
        sb.append(sessionTime);
        sb.append(", histName: ");
        sb.append(histName);
        sb.append(", results: ");
        sb.append(results);
        sb.append(", analysisTime: ");
        sb.append(analysisTime);
        sb.append(", createdDate: ");
        sb.append(createdDate);
        sb.append(", createdBy: ");
        sb.append(createdBy);
        sb.append(", modifiedDate: ");
        sb.append(modifiedDate);
        sb.append(", modifiedBy: ");
        sb.append(modifiedBy);
        sb.append("]");
        return sb.toString();
    }
}





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-with-Cassandra-questions-errors-tp9607p9900.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message