JPA Named Query on Embeddable objects
up vote
0
down vote
favorite
I'm using Spring Data Jpa on this project. I have an entity and an embeddable object.
@Embeddable
public class LocalizedName {
private String localeTag;
private String value;
..getter/setter
}
@Entity
@NamedEntityGraph(
name = "graph.Country.name",
attributeNodes = @NamedAttributeNode(value = "name", subgraph = "name-subgraph"),
subgraphs = {
@NamedSubgraph(name = "name-subgraph", attributeNodes = @NamedAttributeNode("value"))
}
)
public class Country {
@Id
private String code;
@Embedded
private LocalizedName name;
..getter/setter
}
When i run application it throws an exception that
Caused by: java.lang.IllegalArgumentException: Attribute [name] is not of managed type
I think Hibernate @Embeddable objects managed type. How can i solve this problem?
hibernate spring-data-jpa
add a comment |
up vote
0
down vote
favorite
I'm using Spring Data Jpa on this project. I have an entity and an embeddable object.
@Embeddable
public class LocalizedName {
private String localeTag;
private String value;
..getter/setter
}
@Entity
@NamedEntityGraph(
name = "graph.Country.name",
attributeNodes = @NamedAttributeNode(value = "name", subgraph = "name-subgraph"),
subgraphs = {
@NamedSubgraph(name = "name-subgraph", attributeNodes = @NamedAttributeNode("value"))
}
)
public class Country {
@Id
private String code;
@Embedded
private LocalizedName name;
..getter/setter
}
When i run application it throws an exception that
Caused by: java.lang.IllegalArgumentException: Attribute [name] is not of managed type
I think Hibernate @Embeddable objects managed type. How can i solve this problem?
hibernate spring-data-jpa
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm using Spring Data Jpa on this project. I have an entity and an embeddable object.
@Embeddable
public class LocalizedName {
private String localeTag;
private String value;
..getter/setter
}
@Entity
@NamedEntityGraph(
name = "graph.Country.name",
attributeNodes = @NamedAttributeNode(value = "name", subgraph = "name-subgraph"),
subgraphs = {
@NamedSubgraph(name = "name-subgraph", attributeNodes = @NamedAttributeNode("value"))
}
)
public class Country {
@Id
private String code;
@Embedded
private LocalizedName name;
..getter/setter
}
When i run application it throws an exception that
Caused by: java.lang.IllegalArgumentException: Attribute [name] is not of managed type
I think Hibernate @Embeddable objects managed type. How can i solve this problem?
hibernate spring-data-jpa
I'm using Spring Data Jpa on this project. I have an entity and an embeddable object.
@Embeddable
public class LocalizedName {
private String localeTag;
private String value;
..getter/setter
}
@Entity
@NamedEntityGraph(
name = "graph.Country.name",
attributeNodes = @NamedAttributeNode(value = "name", subgraph = "name-subgraph"),
subgraphs = {
@NamedSubgraph(name = "name-subgraph", attributeNodes = @NamedAttributeNode("value"))
}
)
public class Country {
@Id
private String code;
@Embedded
private LocalizedName name;
..getter/setter
}
When i run application it throws an exception that
Caused by: java.lang.IllegalArgumentException: Attribute [name] is not of managed type
I think Hibernate @Embeddable objects managed type. How can i solve this problem?
hibernate spring-data-jpa
hibernate spring-data-jpa
asked Nov 10 at 15:39
Bora SAYINER
1112
1112
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240523%2fjpa-named-query-on-embeddable-objects%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown