Quantcast
Channel: Programação - GUJ
Viewing all articles
Browse latest Browse all 33093

JPA - @Transient

$
0
0

@mpissolato escreveu:

Tenho uma coluna virtual, onde ela não pode ser considerada para insert ou update.

@Transient
@Column(name = "tp_coragenda", insertable = false, updatable = false)
private String tpCoragenda;

Apenas usando o "insertable = false, updatable = false" é exigido a coluna no banco e se eu usar @Transient é apresentado o seguinte erro:

javax.servlet.ServletException: Exception [EclipseLink-30005] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)
Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [uauanna.persistence] failed.
Internal Exception: Exception [EclipseLink-7153] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Mapping annotations cannot be applied to fields or properties that have a @Transient specified. [field tpCoragenda] is in violation of this restriction.

Alguem sabe me informar como desconsiderar uma coluna virtual para inserção e update?

Mensagens: 4

Participantes: 2

Ler tópico completo


Viewing all articles
Browse latest Browse all 33093


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>