【发布时间】:2013-11-27 21:31:06
【问题描述】:
我正在尝试使用 datanucleus 在视图上插入,问题是,当我将 @Persistent 放入表中没有相应字段的字段时,我发现了错误:
11:03:42,782 INFO [br.com.sigel.server.censo.dao.persistentDAO.ParametrosCensoDAO] - javax.jdo.JDODataStoreException:抛出异常,刷新对数据存储的更改 嵌套的Throwables: java.sql.BatchUpdateException: ORA-01733: virtual column not allowed here
但是当我输入@NotPersistent 时,不要从视图中获取字段并且字段保持为空。 我需要这些字段根据视图完成,但永远不会被覆盖(只读)。
我的代码是:
@PersistenceCapable(identityType = IdentityType.APPLICATION,detachable="true", table="VW_FILA_CENSO")
@Sequence(datastoreSequence = "SEQ_SG_FICE_SEQ", strategy = SequenceStrategy.CONTIGUOUS, name = "seqFice")
@Cacheable("false")
public class SG_Fila_Censo implements BeanModelTag,Serializable {
private static final long serialVersionUID = 1L;
@NotPersistent
private Integer escoSeq;
@Persistent(primaryKey="true", valueStrategy=IdGeneratorStrategy.SEQUENCE, sequence="seqFice")
private Integer fice_seq;
@Persistent
private Date fice_data_solicitacao;
@Persistent
private Boolean fice_processando;
@Persistent
private Boolean fice_priorizado;
@Persistent
private Integer fice_rece_seq;
@Persistent
private Integer fice_colb_seq;
@Persistent
private String unidade_escolar;
@Persistent
private String nome_colaborador;
@Persistent
private Integer etapa_relatorio;
@Persistent
private String cree_cod;
...
我的看法是:
CREATE OR REPLACE VIEW "SCH_SECULT3"."VW_FILA_CENSO"
(FICE_SEQ,FICE_DATA_SOLICITACAO,FICE_PROCESSANDO,FICE_PRIORIZADO,FICE_RECE_SEQ,FICE_COLB_SEQ,unidade_escolar,nome_colaborador,cree_cod,etapa_relatorio)
AS
(SELECT
SG_FILA_CENSO.FICE_SEQ,
SG_FILA_CENSO.FICE_DATA_SOLICITACAO,
SG_FILA_CENSO.FICE_PROCESSANDO,
SG_FILA_CENSO.FICE_PRIORIZADO,
SG_FILA_CENSO.FICE_RECE_SEQ,
SG_FILA_CENSO.FICE_COLB_SEQ,
VW_RELATORIO_CENSO.unidade_escolar,
VW_RELATORIO_CENSO.nome_colaborador,
VW_RELATORIO_CENSO.cree_cod,
VW_RELATORIO_CENSO.rece_etapa
FROM SG_FILA_CENSO,VW_RELATORIO_CENSO
where SG_FILA_CENSO.fice_rece_seq = VW_RELATORIO_CENSO.rece_seq
);
有人可以帮助我吗?谢谢。
【问题讨论】:
标签: annotations datanucleus persistent