- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个相当简单的设置,其中有一个 UserEntity 和一个相应的 UserStatisticEntity。我希望这是一个单向关系,其中 UserEntity 持有引用。 UserStatisticEntity 应该与 UserEntity 一起保留和删除,为此我使用 CascadeType.PERSIST 和 REMOVE。我正在使用 Glassfish4 和 Eclipselink。目前我是这样做的:
用户实体:
@Entity
public class UserEntity extends AdditionalEntityInformation {
@Id
@SequenceGenerator(name="seqGenUserId")
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="seqGenUserId")
private long userId;
@OneToOne(cascade={CascadeType.PERSIST, CascadeType.REMOVE})
@JoinColumn(name="STAT_ID", unique=true, nullable=false, updatable=false, insertable=false)
@Basic(optional=false)
@Column(nullable=false)
private UserStatisticEntity stats;
...
public UserEntity(String username, String passwordHash, UserStatisticEntity stats) {
this.username = username;
this.passwordHash = passwordHash;
this.stats = stats;
this.loggedIn = false;
}
}
用户统计实体:
@Entity
public class UserStatisticEntity extends StatisticEntity {
private static final long serialVersionUID = 1L;
@Basic(fetch=FetchType.EAGER, optional=true)
private Date lastLogin;
}
不幸的是,这不起作用,当我持久化一个 UserEntity 时,相应的 UserStatisticEntity 没有持久化。
我错过了什么?(这可能非常简单明了,但就我的生活而言,我没有看到它)
编辑:下表是根据类(重要的东西)创建的:
用户实体:
USERID bigint(20)
STATS longblob
用户统计实体:
ID bigint(20)
LASTLOGIN datetime
以下代码用于创建两个实体并持久化它们。
UserStatisticEntity stats = new UserStatisticEntity(0, 0, 0, null);
UserEntity u = new UserEntity(username, hashingBean.hashString(password), stats);
em.persist(u);
UserEntity 的持久化有效,但持久化不会级联到 UserStatisticEntity。
我拥有的日志记录:
2016-10-19T13:00:00.925+0200|Konfiguration: The access type for the persistent class [class de.fh_dortmund.hansen.chat.entity.AdditionalEntityInformation] is set to [FIELD].
2016-10-19T13:00:00.935+0200|Konfiguration: The access type for the persistent class [class de.fh_dortmund.hansen.chat.entity.UserEntity] is set to [FIELD].
2016-10-19T13:00:00.936+0200|Konfiguration: The access type for the persistent class [class de.fh_dortmund.hansen.chat.entity.StatisticEntity] is set to [FIELD].
2016-10-19T13:00:00.937+0200|Konfiguration: The access type for the persistent class [class de.fh_dortmund.hansen.chat.entity.UserStatisticEntity] is set to [FIELD].
2016-10-19T13:00:00.937+0200|Konfiguration: The access type for the persistent class [class de.fh_dortmund.hansen.chat.entity.CommonStatisticEntity] is set to [FIELD].
2016-10-19T13:00:00.940+0200|Konfiguration: The column name for element [createdAt] is being defaulted to: CREATEDAT.
2016-10-19T13:00:00.942+0200|Konfiguration: The column name for element [updatedAt] is being defaulted to: UPDATEDAT.
2016-10-19T13:00:00.942+0200|Konfiguration: The alias name for the entity class [class de.fh_dortmund.hansen.chat.entity.UserEntity] is being defaulted to: UserEntity.
2016-10-19T13:00:00.942+0200|Konfiguration: The table name for entity [class de.fh_dortmund.hansen.chat.entity.UserEntity] is being defaulted to: USERENTITY.
2016-10-19T13:00:00.946+0200|Konfiguration: The column name for element [createdAt] is being defaulted to: CREATEDAT.
2016-10-19T13:00:00.947+0200|Konfiguration: The column name for element [stats] is being defaulted to: STATS.
2016-10-19T13:00:00.948+0200|Konfiguration: The column name for element [loggedIn] is being defaulted to: LOGGEDIN.
2016-10-19T13:00:00.948+0200|Konfiguration: The column name for element [userId] is being defaulted to: USERID.
2016-10-19T13:00:00.948+0200|Konfiguration: The column name for element [passwordHash] is being defaulted to: PASSWORDHASH.
2016-10-19T13:00:00.949+0200|Konfiguration: The column name for element [username] is being defaulted to: USERNAME.
2016-10-19T13:00:00.949+0200|Konfiguration: The column name for element [updatedAt] is being defaulted to: UPDATEDAT.
2016-10-19T13:00:00.949+0200|Konfiguration: The alias name for the entity class [class de.fh_dortmund.hansen.chat.entity.UserStatisticEntity] is being defaulted to: UserStatisticEntity.
2016-10-19T13:00:00.950+0200|Konfiguration: The alias name for the entity class [class de.fh_dortmund.hansen.chat.entity.StatisticEntity] is being defaulted to: StatisticEntity.
2016-10-19T13:00:00.950+0200|Konfiguration: The table name for entity [class de.fh_dortmund.hansen.chat.entity.StatisticEntity] is being defaulted to: STATISTICENTITY.
2016-10-19T13:00:00.950+0200|Konfiguration: The column name for element [createdAt] is being defaulted to: CREATEDAT.
2016-10-19T13:00:00.951+0200|Konfiguration: The column name for element [logouts] is being defaulted to: LOGOUTS.
2016-10-19T13:00:00.951+0200|Konfiguration: The column name for element [messages] is being defaulted to: MESSAGES.
2016-10-19T13:00:00.951+0200|Konfiguration: The column name for element [id] is being defaulted to: ID.
2016-10-19T13:00:00.952+0200|Konfiguration: The column name for element [logins] is being defaulted to: LOGINS.
2016-10-19T13:00:00.952+0200|Konfiguration: The column name for element [updatedAt] is being defaulted to: UPDATEDAT.
2016-10-19T13:00:00.952+0200|Konfiguration: The table name for entity [class de.fh_dortmund.hansen.chat.entity.UserStatisticEntity] is being defaulted to: USERSTATISTICENTITY.
2016-10-19T13:00:00.952+0200|Konfiguration: The column name for element [lastLogin] is being defaulted to: LASTLOGIN.
2016-10-19T13:00:00.953+0200|Konfiguration: The column name for element [createdAt] is being defaulted to: CREATEDAT.
2016-10-19T13:00:00.953+0200|Konfiguration: The column name for element [logouts] is being defaulted to: LOGOUTS.
2016-10-19T13:00:00.954+0200|Konfiguration: The column name for element [messages] is being defaulted to: MESSAGES.
2016-10-19T13:00:00.954+0200|Konfiguration: The column name for element [id] is being defaulted to: ID.
2016-10-19T13:00:00.955+0200|Konfiguration: The column name for element [logins] is being defaulted to: LOGINS.
2016-10-19T13:00:00.956+0200|Konfiguration: The column name for element [updatedAt] is being defaulted to: UPDATEDAT.
2016-10-19T13:00:00.956+0200|Konfiguration: The alias name for the entity class [class de.fh_dortmund.hansen.chat.entity.CommonStatisticEntity] is being defaulted to: CommonStatisticEntity.
2016-10-19T13:00:00.956+0200|Konfiguration: The table name for entity [class de.fh_dortmund.hansen.chat.entity.CommonStatisticEntity] is being defaulted to: COMMONSTATISTICENTITY.
2016-10-19T13:00:00.956+0200|Konfiguration: The column name for element [createdAt] is being defaulted to: CREATEDAT.
2016-10-19T13:00:00.957+0200|Konfiguration: The column name for element [logouts] is being defaulted to: LOGOUTS.
2016-10-19T13:00:00.957+0200|Konfiguration: The column name for element [endDate] is being defaulted to: ENDDATE.
2016-10-19T13:00:00.957+0200|Konfiguration: The column name for element [messages] is being defaulted to: MESSAGES.
2016-10-19T13:00:00.957+0200|Konfiguration: The column name for element [id] is being defaulted to: ID.
2016-10-19T13:00:00.958+0200|Konfiguration: The column name for element [startingDate] is being defaulted to: STARTINGDATE.
2016-10-19T13:00:00.958+0200|Konfiguration: The column name for element [logins] is being defaulted to: LOGINS.
2016-10-19T13:00:00.958+0200|Konfiguration: The column name for element [updatedAt] is being defaulted to: UPDATEDAT.
2016-10-19T13:00:00.958+0200|Konfiguration: The sequence name for the sequence generator named [seqGenStatId] defined on [field id] from [field id] is being defaulted to: seqGenStatId.
2016-10-19T13:00:00.959+0200|Konfiguration: The sequence name for the sequence generator named [seqGenUserId] defined on [field userId] from [field userId] is being defaulted to: seqGenUserId.
2016-10-19T13:00:00.960+0200|Feiner: Class [de.fh_dortmund.hansen.chat.entity.UserEntity] registered to be processed by weaver.
2016-10-19T13:00:00.962+0200|Feiner: Class [de.fh_dortmund.hansen.chat.entity.UserStatisticEntity] registered to be processed by weaver.
2016-10-19T13:00:00.962+0200|Feiner: Class [de.fh_dortmund.hansen.chat.entity.StatisticEntity] registered to be processed by weaver.
2016-10-19T13:00:00.962+0200|Feiner: Class [de.fh_dortmund.hansen.chat.entity.CommonStatisticEntity] registered to be processed by weaver.
2016-10-19T13:00:01.027+0200|Am feinsten: End predeploying Persistence Unit ChatDB; session /file:/D:/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-ejb_jar/_ChatDB; state Predeployed; factoryCount 1
2016-10-19T13:00:01.032+0200|Feiner: Canonical Metamodel class [de.fh_dortmund.hansen.chat.entity.StatisticEntity_] not found during initialization.
2016-10-19T13:00:01.032+0200|Feiner: Canonical Metamodel class [de.fh_dortmund.hansen.chat.entity.CommonStatisticEntity_] not found during initialization.
2016-10-19T13:00:01.033+0200|Feiner: Canonical Metamodel class [de.fh_dortmund.hansen.chat.entity.UserEntity_] not found during initialization.
2016-10-19T13:00:01.033+0200|Feiner: Canonical Metamodel class [de.fh_dortmund.hansen.chat.entity.UserStatisticEntity_] not found during initialization.
2016-10-19T13:00:01.033+0200|Feiner: Canonical Metamodel class [de.fh_dortmund.hansen.chat.entity.AdditionalEntityInformation_] not found during initialization.
2016-10-19T13:00:01.370+0200|Am feinsten: Begin deploying Persistence Unit ChatDB; session /file:/D:/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-ejb_jar/_ChatDB; state Predeployed; factoryCount 1
2016-10-19T13:00:01.374+0200|Am feinsten: Begin weaver class transformer processing class [de/fh_dortmund/hansen/chat/entity/UserEntity].
2016-10-19T13:00:01.381+0200|Am feinsten: Weaved change tracking (ChangeTracker) [de/fh_dortmund/hansen/chat/entity/UserEntity].
2016-10-19T13:00:01.382+0200|Am feinsten: Weaved fetch groups (FetchGroupTracker) [de/fh_dortmund/hansen/chat/entity/UserEntity].
2016-10-19T13:00:01.382+0200|Am feinsten: End weaver class transformer processing class [de/fh_dortmund/hansen/chat/entity/UserEntity].
2016-10-19T13:00:01.382+0200|Information: de.fh_dortmund.hansen.chat.entity.UserEntity actually got transformed
2016-10-19T13:00:01.389+0200|Am feinsten: Begin weaver class transformer processing class [de/fh_dortmund/hansen/chat/entity/AdditionalEntityInformation].
2016-10-19T13:00:01.390+0200|Am feinsten: Weaved persistence (PersistenceEntity) [de/fh_dortmund/hansen/chat/entity/AdditionalEntityInformation].
2016-10-19T13:00:01.391+0200|Am feinsten: Weaved change tracking (ChangeTracker) [de/fh_dortmund/hansen/chat/entity/AdditionalEntityInformation].
2016-10-19T13:00:01.391+0200|Am feinsten: Weaved fetch groups (FetchGroupTracker) [de/fh_dortmund/hansen/chat/entity/AdditionalEntityInformation].
2016-10-19T13:00:01.391+0200|Am feinsten: Weaved REST [de/fh_dortmund/hansen/chat/entity/AdditionalEntityInformation].
2016-10-19T13:00:01.391+0200|Am feinsten: End weaver class transformer processing class [de/fh_dortmund/hansen/chat/entity/AdditionalEntityInformation].
2016-10-19T13:00:01.391+0200|Information: de.fh_dortmund.hansen.chat.entity.AdditionalEntityInformation actually got transformed
2016-10-19T13:00:01.400+0200|Am feinsten: Begin weaver class transformer processing class [de/fh_dortmund/hansen/chat/entity/UserStatisticEntity].
2016-10-19T13:00:01.401+0200|Am feinsten: Weaved change tracking (ChangeTracker) [de/fh_dortmund/hansen/chat/entity/UserStatisticEntity].
2016-10-19T13:00:01.401+0200|Am feinsten: Weaved fetch groups (FetchGroupTracker) [de/fh_dortmund/hansen/chat/entity/UserStatisticEntity].
2016-10-19T13:00:01.401+0200|Am feinsten: End weaver class transformer processing class [de/fh_dortmund/hansen/chat/entity/UserStatisticEntity].
2016-10-19T13:00:01.401+0200|Information: de.fh_dortmund.hansen.chat.entity.UserStatisticEntity actually got transformed
2016-10-19T13:00:01.402+0200|Am feinsten: Begin weaver class transformer processing class [de/fh_dortmund/hansen/chat/entity/StatisticEntity].
2016-10-19T13:00:01.403+0200|Am feinsten: Weaved change tracking (ChangeTracker) [de/fh_dortmund/hansen/chat/entity/StatisticEntity].
2016-10-19T13:00:01.404+0200|Am feinsten: Weaved fetch groups (FetchGroupTracker) [de/fh_dortmund/hansen/chat/entity/StatisticEntity].
2016-10-19T13:00:01.404+0200|Am feinsten: End weaver class transformer processing class [de/fh_dortmund/hansen/chat/entity/StatisticEntity].
2016-10-19T13:00:01.405+0200|Information: de.fh_dortmund.hansen.chat.entity.StatisticEntity actually got transformed
2016-10-19T13:00:01.420+0200|Am feinsten: Begin weaver class transformer processing class [de/fh_dortmund/hansen/chat/entity/CommonStatisticEntity].
2016-10-19T13:00:01.422+0200|Am feinsten: Weaved change tracking (ChangeTracker) [de/fh_dortmund/hansen/chat/entity/CommonStatisticEntity].
2016-10-19T13:00:01.422+0200|Am feinsten: Weaved fetch groups (FetchGroupTracker) [de/fh_dortmund/hansen/chat/entity/CommonStatisticEntity].
2016-10-19T13:00:01.423+0200|Am feinsten: End weaver class transformer processing class [de/fh_dortmund/hansen/chat/entity/CommonStatisticEntity].
2016-10-19T13:00:01.423+0200|Information: de.fh_dortmund.hansen.chat.entity.CommonStatisticEntity actually got transformed
2016-10-19T13:00:01.449+0200|Feiner: initializing session manager
2016-10-19T13:00:01.451+0200|Am feinsten: property=eclipselink.target-server; value=SunAS9; translated value=org.eclipse.persistence.platform.server.sunas.SunAS9ServerPlatform
2016-10-19T13:00:01.451+0200|Am feinsten: property=eclipselink.logging.level; value=FINEST; translated value=FINEST
2016-10-19T13:00:01.452+0200|Am feinsten: property=eclipselink.logging.level; value=FINEST; translated value=FINEST
2016-10-19T13:00:01.452+0200|Am feinsten: property=eclipselink.target-database; value=MySQL; translated value=org.eclipse.persistence.platform.database.MySQLPlatform
2016-10-19T13:00:01.465+0200|Information: EclipseLink, version: Eclipse Persistence Services - 2.6.1.v20150605-31e8258
2016-10-19T13:00:01.470+0200|Konfiguration: connecting(DatabaseLogin(
platform=>MySQLPlatform
user name=> ""
connector=>JNDIConnector datasource name=>null
))
2016-10-19T13:00:01.922+0200|Konfiguration: Connected: jdbc:mysql://localhost:3306/chat
User: chat@localhost
Database: MySQL Version: 5.7.16-log
Driver: MySQL Connector Java Version: mysql-connector-java-5.1.40 ( Revision: 402933ef52cad9aa82624e80acbea46e3a701ce6 )
2016-10-19T13:00:01.922+0200|Am feinsten: Connection acquired from connection pool [read].
2016-10-19T13:00:01.922+0200|Am feinsten: Connection released to connection pool [read].
2016-10-19T13:00:01.922+0200|Konfiguration: connecting(DatabaseLogin(
platform=>MySQLPlatform
user name=> ""
connector=>JNDIConnector datasource name=>null
))
2016-10-19T13:00:01.923+0200|Konfiguration: Connected: jdbc:mysql://localhost:3306/chat
User: chat@localhost
Database: MySQL Version: 5.7.16-log
Driver: MySQL Connector Java Version: mysql-connector-java-5.1.40 ( Revision: 402933ef52cad9aa82624e80acbea46e3a701ce6 )
2016-10-19T13:00:01.929+0200|Am feinsten: sequencing connected, state is NoPreallocation_State
2016-10-19T13:00:01.930+0200|Am feinsten: sequence seqGenStatId: preallocation size 50
2016-10-19T13:00:01.930+0200|Am feinsten: sequence seqGenUserId: preallocation size 50
2016-10-19T13:00:02.000+0200|Information: /file:/D:/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-ejb_jar/_ChatDB login successful
2016-10-19T13:00:02.000+0200|Feiner: JMX MBeanServer instance found: [com.sun.enterprise.v3.admin.DynamicInterceptor@897b71], # of beans: [24], domain: [DefaultDomain] at index: [0].
2016-10-19T13:00:02.002+0200|Am feinsten: Registered MBean: org.eclipse.persistence.services.mbean.MBeanDevelopmentServices[TopLink:Name=Development-/file_/D_/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-ejb_jar/_ChatDB,Type=Configuration] on server com.sun.enterprise.v3.admin.DynamicInterceptor@897b71
2016-10-19T13:00:02.003+0200|Am feinsten: Registered MBean: org.eclipse.persistence.services.glassfish.MBeanGlassfishRuntimeServices[TopLink:Name=Session(/file_/D_/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-ejb_jar/_ChatDB)] on server com.sun.enterprise.v3.admin.DynamicInterceptor@897b71
2016-10-19T13:00:02.003+0200|Am feinsten: EclipseLink JMX Runtime Services is referencing the [Platform ConversionManager] ClassLoader at: [EarClassLoader :
urlSet = [URLEntry : file:/D:/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-ejb_jar/, URLEntry : file:/D:/glassfish4/glassfish/domains/domain1/generated/ejb/Chat-ear/Chat-ejb_jar, URLEntry : file:/D:/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-common.jar/]
doneCalled = false
Parent -> org.glassfish.internal.api.DelegatingClassLoader@73b5a73d
]
2016-10-19T13:00:02.003+0200|Am feinsten: The applicationName for the MBean attached to session [/file:/D:/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-ejb_jar/_ChatDB] is [D:/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-ejb_jar/_URLEntry _file:/D:/glassfish4/glassfish/domains/domain1/generated/ejb/Chat-ear/Chat-ejb_jar_URLEntry _file:/D:/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-common.jar/]
2016-10-19T13:00:02.003+0200|Am feinsten: The moduleName for the MBean attached to session [/file:/D:/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-ejb_jar/_ChatDB] is [_ChatDB]
2016-10-19T13:00:02.015+0200|Am feinsten: The table (COMMONSTATISTICENTITY) is created.
2016-10-19T13:00:02.016+0200|Am feinsten: The table (USERENTITY) is created.
2016-10-19T13:00:02.016+0200|Am feinsten: The table (USERSTATISTICENTITY) is created.
2016-10-19T13:00:02.018+0200|Feiner: Canonical Metamodel class [de.fh_dortmund.hansen.chat.entity.StatisticEntity_] not found during initialization.
2016-10-19T13:00:02.019+0200|Feiner: Canonical Metamodel class [de.fh_dortmund.hansen.chat.entity.CommonStatisticEntity_] not found during initialization.
2016-10-19T13:00:02.020+0200|Feiner: Canonical Metamodel class [de.fh_dortmund.hansen.chat.entity.UserEntity_] not found during initialization.
2016-10-19T13:00:02.021+0200|Feiner: Canonical Metamodel class [de.fh_dortmund.hansen.chat.entity.UserStatisticEntity_] not found during initialization.
2016-10-19T13:00:02.022+0200|Feiner: Canonical Metamodel class [de.fh_dortmund.hansen.chat.entity.AdditionalEntityInformation_] not found during initialization.
2016-10-19T13:00:02.022+0200|Am feinsten: End deploying Persistence Unit ChatDB; session /file:/D:/glassfish4/glassfish/domains/domain1/eclipseApps/Chat-ear/Chat-ejb_jar/_ChatDB; state Deployed; factoryCount 1
2016-10-19T13:00:09.314+0200|Fein: SELECT COUNT(USERID) FROM USERENTITY WHERE (USERNAME = ?)
bind => [1 parameter bound]
2016-10-19T13:00:09.333+0200|Am feinsten: Connection released to connection pool [read].
2016-10-19T13:00:09.335+0200|Am feinsten: persist() operation called on: de.fh_dortmund.hansen.chat.entity.CommonStatisticEntity@2a0f113c.
2016-10-19T13:00:09.397+0200|Feiner: begin unit of work flush
2016-10-19T13:00:09.397+0200|Feiner: TX beginTransaction, status=STATUS_ACTIVE
2016-10-19T13:00:09.398+0200|Am feinsten: Execute query InsertObjectQuery(de.fh_dortmund.hansen.chat.entity.CommonStatisticEntity@2a0f113c)
2016-10-19T13:00:09.398+0200|Am feinsten: Connection acquired from connection pool [default].
2016-10-19T13:00:09.398+0200|Am feinsten: reconnecting to external connection pool
2016-10-19T13:00:09.399+0200|Fein: INSERT INTO COMMONSTATISTICENTITY (CREATEDAT, ENDDATE, LOGINS, LOGOUTS, MESSAGES, STARTINGDATE, UPDATEDAT) VALUES (?, ?, ?, ?, ?, ?, ?)
bind => [7 parameters bound]
2016-10-19T13:00:09.405+0200|Am feinsten: Execute query ValueReadQuery(name="seqGenStatId" sql="SELECT LAST_INSERT_ID()")
2016-10-19T13:00:09.405+0200|Fein: SELECT LAST_INSERT_ID()
2016-10-19T13:00:09.406+0200|Am feinsten: assign sequence to the object (1 -> de.fh_dortmund.hansen.chat.entity.CommonStatisticEntity@2a0f113c)
2016-10-19T13:00:09.407+0200|Feiner: end unit of work flush
2016-10-19T13:00:09.408+0200|Feiner: resume unit of work
2016-10-19T13:00:09.408+0200|Am feinsten: Execute query ReportQuery(name="getNumUsersWithName" referenceClass=UserEntity sql="SELECT COUNT(USERID) FROM USERENTITY WHERE (USERNAME = ?)")
2016-10-19T13:00:09.409+0200|Fein: SELECT COUNT(USERID) FROM USERENTITY WHERE (USERNAME = ?)
bind => [1 parameter bound]
2016-10-19T13:00:09.412+0200|Am feinsten: persist() operation called on: de.fh_dortmund.hansen.chat.entity.UserEntity@b49eec8.
2016-10-19T13:00:09.421+0200|Feiner: TX beforeCompletion callback, status=STATUS_ACTIVE
2016-10-19T13:00:09.421+0200|Feiner: begin unit of work commit
2016-10-19T13:00:09.422+0200|Am feinsten: Execute query InsertObjectQuery(de.fh_dortmund.hansen.chat.entity.UserEntity@b49eec8)
2016-10-19T13:00:09.423+0200|Fein: INSERT INTO USERENTITY (CREATEDAT, LOGGEDIN, PASSWORDHASH, STATS, UPDATEDAT, USERNAME) VALUES (?, ?, ?, ?, ?, ?)
bind => [6 parameters bound]
2016-10-19T13:00:09.425+0200|Am feinsten: Execute query ValueReadQuery(name="seqGenUserId" sql="SELECT LAST_INSERT_ID()")
2016-10-19T13:00:09.425+0200|Fein: SELECT LAST_INSERT_ID()
2016-10-19T13:00:09.426+0200|Am feinsten: assign sequence to the object (1 -> de.fh_dortmund.hansen.chat.entity.UserEntity@b49eec8)
2016-10-19T13:00:09.431+0200|Am feinsten: Connection released to connection pool [default].
EDIT2:UserStatisticEntity 可通过继承进行序列化,如果我删除该序列化性,我的 ejb 部署将中断,并出现此错误:
Exception Description: The type [class de.fh_dortmund.hansen.chat.entity.UserStatisticEntity] for the attribute [stats] on the entity class [class de.fh_dortmund.hansen.chat.entity.UserEntity] is not a valid type for a serialized mapping. The attribute type must implement the Serializable interface.
最佳答案
解决方案真的和我想的一样简单。出于某种原因,Eclipselink 对一个 UserStatisticEntity 是可序列化的并且我在 stats 字段上有所有这些注释这一事实感到非常困扰。在使其不可序列化然后删除 @Basic 和 @Column 注释后,以下代码有效:
@OneToOne(cascade={CascadeType.PERSIST, CascadeType.REMOVE})
@JoinColumn(nullable=false,unique=true)
private UserStatisticEntity stats;
关于java - JPA CascadeType 仍然无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40128859/
自从我 faced an issue由于背景图片对于不同分辨率的内容来说太短,我尝试将背景分成 3 部分并自动拉伸(stretch)中间部分以相应地填充顶部和底部图像之间的空间。不幸的是我没能在 CS
我从去年开始就在我的程序中运行这个函数(Linux 和 Windows)。 现在我需要实现一个新功能,我的新构建不再运行。 我还有其他使用 POST 的 CUrl 函数,结果是一样的:没问题,但我的
在评估函数应用方面,Haskell 是只支持普通降阶还是也支持应用降阶?我是否认为正常顺序是 Haskell 惰性的原因? 最佳答案 GHC 运行时不使用术语缩减策略,因为那会非常低效。事实上,GHC
怎么来的multi使用多处理池对多个“进程”上的数据进行分段和处理的函数比仅调用 map 慢(8 秒)。功能(6 秒)? from multiprocessing import Pool import
假设我正在渲染一个 3d GL_TRIANGLE。该对象需要 3 个顶点才能定义:A、B、C。我将此类数据放入缓冲区并通过 glVertexAttribPointer 将其绑定(bind)到着色器。
我有一个字体的三个文件,普通的,粗体的和浅色的。由于 font-weight:light 不存在,我该如何在 font-face 上设置 light 呢? 顺便问一下,font-weight:ligh
我是 C 的新手,我似乎无法弄清楚什么似乎是一个非常简单的指针问题。我的程序将行号添加到文件中。它逐行读入文件,然后在每行的开头添加一个行号。它在每个文件上都可以正常工作,如下所示: soccer@s
我有以下代码,我不确定为什么当它命中 Myclass 的析构函数时我会收到堆损坏检测错误。我相信我正在正确地释放内存?? #include #include using namespace std
有什么方法可以将“正常”数学符号解释为逆波兰符号 (RPN)..? 例如1) 2 + 3*4 - 1 = 234*+1-2) 5 (4-8) = 548- 你可以假设遵循 BODMAS 规则并且必须首
http://www.ergotopia.de/ergonomie-shop/ergonomische-kissen/orthopaedisches-sitzkissen的手机页面应该看起来像右边(检
我正在 Phonegap/Cordova 中构建一个应用程序。应用目前相当简单,但确实需要网络状态和地理定位插件才能工作。 到目前为止,我已经在 Android 上开发了该应用程序(目前它仅由一些基本
我一整天都在做这个,但没有运气 我设法在一行 TfidfVectorizer 中消除了问题 这是我的工作代码 from sklearn.feature_extraction.text import C
也许有人看到一个错误,问题是当我按btn2 (button 2)和btn3 (button 3)应用程序crashes时,但操作仍然有效,即video正在运行并且PDF打开,而button 1正常工作
我正在开发一个应用程序。它的第一页是登录屏幕。成功登录后,我想将用户带到选项卡式 Activity 。我怎样才能在安卓中做到这一点?谢谢 最佳答案 在 Android 中,启动 Activity 是通
我不确定我在这里做错了什么。 :normal! I### 当我对一个单词执行此命令时,我想要的最终结果是: ### word 但是我得到了这个: ###word 最佳答案 Vim 的 :normal是
我必须将 2 个静态矩阵发送到分配动态矩阵的函数,将矩阵 1 乘以矩阵 2,并返回新矩阵的地址。请注意,COMM 很常见。 我尝试删除 free_matrix 行,它工作正常。 void main()
我在我的一个项目中使用 Gnome libglib 并遇到了一个奇怪的错误。我可以输入 GList 的元素数量看起来仅限于 45 个。在第 45 个元素处,它给出了此错误 40 counter 41
我正在尝试获取“顶级”HWND 的尺寸。即,我想要 Firefox/Windows 资源管理器等的主 HWND 的当前尺寸。窗口。如果窗口最小化, GetWindowRect() 将不起作用。 Get
相同的标题:什么是索引 - 正常 - 全文 - 唯一? 最佳答案 普通索引用于通过仅包含行数据的切片或散列来加速操作。 全文索引向数据库的全文搜索 (FTS) 引擎指示它应该将数据存档在给定字段中,以
我正在使用 EnumParser来自 here它在 VC++ 中编译得很好,但是使用 gcc 我有这样的错误: ./Terminator.o: In function `EnumParser::Enu
我是一名优秀的程序员,十分优秀!