Skip to content

Commit

Permalink
OGM-783 Update test related to embeddedable associations
Browse files Browse the repository at this point in the history
  Change the test to work with a multi-path game scenario and update the queries for the existing
  tests.
  • Loading branch information
DavideD committed May 15, 2015
1 parent 6518382 commit e407772
Show file tree
Hide file tree
Showing 15 changed files with 602 additions and 579 deletions.

This file was deleted.

This file was deleted.

Expand Up @@ -13,39 +13,39 @@
import org.hibernate.search.annotations.Store;

@Embeddable
public class AnotherEmbeddable {
public class Ending {

// Store.YES for filtering in query
// Analyze.NO for projection in query
@Field(store = Store.YES, analyze = Analyze.NO)
private String embeddedString;
private String text;

// Store.YES for filtering in query
// Analyze.NO for projection in query
@Field(store = Store.YES, analyze = Analyze.NO)
private Integer embeddedInteger;
private Integer score;

public AnotherEmbeddable() {
public Ending() {
}

public AnotherEmbeddable(String embeddedString, Integer embeddedInteger) {
this.embeddedString = embeddedString;
this.embeddedInteger = embeddedInteger;
public Ending(String text, Integer score) {
this.text = text;
this.score = score;
}

public String getEmbeddedString() {
return embeddedString;
public String getText() {
return text;
}

public void setEmbeddedString(String embeddedString) {
this.embeddedString = embeddedString;
public void setText(String text) {
this.text = text;
}

public Integer getEmbeddedInteger() {
return embeddedInteger;
public Integer getScore() {
return score;
}

public void setEmbeddedInteger(Integer embeddedInteger) {
this.embeddedInteger = embeddedInteger;
public void setScore(Integer score) {
this.score = score;
}
}
@@ -0,0 +1,73 @@
/*
* Hibernate OGM, Domain model persistence for NoSQL datastores
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ogm.backendtck.queries;

import javax.persistence.Embeddable;

import org.hibernate.search.annotations.Analyze;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.IndexedEmbedded;
import org.hibernate.search.annotations.Store;

@Embeddable
public class OptionalStoryBranch {

// Store.YES for filtering in query
// Analyze.NO for projection in query
@Field(store = Store.YES, analyze = Analyze.NO)
private String evilText;

@Field(store = Store.YES, analyze = Analyze.NO)
private String goodText;

@IndexedEmbedded
private Ending evilEnding;

@IndexedEmbedded
private Ending goodEnding;

public OptionalStoryBranch() {
}

public OptionalStoryBranch(String evilText, String goodText, Ending evilEnding) {
this.evilText = evilText;
this.goodText = goodText;
this.evilEnding = evilEnding;
}

public String getEvilText() {
return evilText;
}

public void setEvilText(String embeddedString) {
this.evilText = embeddedString;
}

public Ending getEvilEnding() {
return evilEnding;
}

public void setEvilEnding(Ending anotherEmbeddable) {
this.evilEnding = anotherEmbeddable;
}

public String getGoodText() {
return goodText;
}

public void setGoodText(String anotherItem) {
this.goodText = anotherItem;
}

public Ending getGoodEnding() {
return goodEnding;
}

public void setGoodEnding(Ending goodEnding) {
this.goodEnding = goodEnding;
}
}

0 comments on commit e407772

Please sign in to comment.