Commit 6b3e3b47 authored by Matija Obreza's avatar Matija Obreza
Browse files

Replaced MetadataMethod#method with #methodId

parent d496a1e9
......@@ -14,39 +14,27 @@
* limitations under the License.
**/
package org.genesys2.server.model.genesys;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.genesys2.server.model.BusinessModel;
@Entity
@Table(name = "metadatamethod")
public class MetadataMethod implements Serializable {
public class MetadataMethod extends BusinessModel {
private static final long serialVersionUID = -240056837800843686L;
private Long id;
private Metadata metadata;
private Method method;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@ManyToOne(cascade = {}, optional = false)
@JoinColumn(name = "metadataId")
private Metadata metadata;
private long methodId;
public Metadata getMetadata() {
return metadata;
}
......@@ -55,14 +43,11 @@ public class MetadataMethod implements Serializable {
this.metadata = metadata;
}
@ManyToOne(cascade = {}, optional = false)
@JoinColumn(name = "methodId")
public Method getMethod() {
return method;
public long getMethodId() {
return methodId;
}
public void setMethod(Method method) {
this.method = method;
public void setMethodId(long methodId) {
this.methodId = methodId;
}
}
......@@ -20,7 +20,6 @@ import java.util.List;
import org.genesys2.server.model.genesys.Metadata;
import org.genesys2.server.model.genesys.MetadataMethod;
import org.genesys2.server.model.genesys.Method;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
......@@ -28,12 +27,10 @@ public interface MetadataMethodRepository extends JpaRepository<MetadataMethod,
List<MetadataMethod> findByMetadata(Metadata metadata);
List<MetadataMethod> findByMethod(Method method);
@Query("select distinct mm.methodId from MetadataMethod mm where mm.metadata = ?1")
List<Long> listMetadataMethods(Metadata metadata);
@Query("select distinct mm.method from MetadataMethod mm where mm.metadata = ?1")
List<Method> listMetadataMethods(Metadata metadata);
@Query("select distinct mm.metadata from MetadataMethod mm where mm.method = ?1")
List<Metadata> listMetadataByMethod(Method method);
@Query("select distinct mm.metadata from MetadataMethod mm where mm.methodId = ?1")
List<Metadata> listMetadataByMethodId(long methodId);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment