Linked Questions
12 questions linked to/from What is the easiest way to ignore a JPA field during persistence?
224 votes
3 answers
223k views
Make Hibernate ignore instance variables that are not mapped [duplicate]
I thought hibernate takes into consideration only instance variables that are annotated with @Column. But strangely today when I added a variable (that is not mapped to any column, just a variable i ...
11 votes
1 answer
36k views
is it possible to ignore some field when mapping in annotation,Entity class [duplicate]
I am using Hibernate to map with MySQL I have an entity class in which I have the methods mapped with columns in MySQL The question is, if its possible that I do not map some of the method in that ...
4 votes
1 answer
3k views
Can I have a helper/convenient method inside a Hibernate entity class? [duplicate]
I have Entity class with a helper method in it. like this.. @Entity @Table(name = "MEMBER", schema = "APP_SCHEMA") public class Member { private String id; private String externalMemberId; ...
0 votes
1 answer
492 views
Are all instance variables in an entity class persistent in the database? [duplicate]
Are all instance variables in an entity class persistent in the database? Or is it possible for some variables in the entity to be non-persistent?
28 votes
1 answer
45k views
@Transient annotation, @org.springframework.data.annotation.Transient annotation, transient keyword and password storing
Currently I'm learning the Spring framework, mainly focusing on it's Security Module. I've watched some guides in connection with registration and login. I saw this common usage of transient keyword ...
6 votes
3 answers
6k views
Caused by: org.hibernate.MappingException: Could not determine type for: com.fasterxml.jackson.databind.JsonNode
I am trying to use javax.persistence.* to auto create Table by uesing @Entity. Here is some problem. Is there anyway to convert the JsonNode to String By use Annotation. edit: the Jpa is Spring-Data-...
5 votes
1 answer
2k views
JPA Entity static logger
My question is, can i use a static logger in a JPA Entity, or will it cause some problem? I would like to do something like this (the logger is log4j): @Entity public class AlertRule implements ...
0 votes
1 answer
1k views
How to create a model, in Spring, from json where the foreign key is referenced as a long attribute?
One Group has many Users: Group import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonManagedReference; import javax.persistence.*; import java.util....
2 votes
0 answers
1k views
How to prevent Spring boot from creating column for some particular field in modal
I have created a modal in the spring boot application where that modal is an entity. But I want to exclude one field from creating a column from that modal. For instance, below given is my fields in ...
0 votes
1 answer
985 views
JPA to not persist to database but filesystem
I am trying to save a byte[] field to local filesystem instead of the database. I have tried the JPA annotation @Transient @Entity @Table(name = "screenshot") @Cache(usage = CacheConcurrencyStrategy....
2 votes
1 answer
491 views
How to ignore Class field on database insertion but not on retrieval with Hibernate / JPA
I am fairly new to Spring and Hibernate. I'm creating an app to learn them. What I want to do is post a message with a timestamp. So far I was trying to have PostgreSQL take care of the TIMESTAMPTZ ...
0 votes
1 answer
531 views
How can i insert default value in database if attributes is not valid with JPA
I want to set values from an dto object and insert them in database with save jpa repository methode can i insert a default value if attributes is not valid(null or size is to longer) using jpa ? dto ...