-
Notifications
You must be signed in to change notification settings - Fork 1
io microsphere hibernate test entity UserProfile
Type: Class | Module: microsphere-hibernate-test | Package: io.microsphere.hibernate.test.entity | Since: 1.0.0
Source:
microsphere-hibernate-test/src/main/java/io/microsphere/hibernate/test/entity/UserProfile.java
JPA entity representing a user's profile, mapped to the t_user_profile table.
Holds additional personal information (e.g. ID card number) for a User.
`User user = new User();
user.setName("Tom");
UserProfile profile = new UserProfile();
profile.setIdCard("ID123456");
profile.setUser(user);
user.setProfile(profile);
// Persisting the user will cascade to the profile
session.persist(user);
UserProfile loaded = session.get(UserProfile.class, profile.getId());
`
public class UserProfileAuthor: Mercy
-
Introduced in:
1.0.0 -
Current Project Version:
0.2.9-SNAPSHOT
This component is tested and compatible with the following Java versions:
| Java Version | Status |
|---|---|
| Java 17 | ✅ Compatible |
| Java 21 | ✅ Compatible |
| Java 25 | ✅ Compatible |
User user = new User();
user.setName("Tom");
UserProfile profile = new UserProfile();
profile.setIdCard("ID123456");
profile.setUser(user);
user.setProfile(profile);
// Persisting the user will cascade to the profile
session.persist(user);
UserProfile loaded = session.get(UserProfile.class, profile.getId());Add the following dependency to your pom.xml:
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-hibernate-test</artifactId>
<version>${microsphere-hibernate.version}</version>
</dependency>Tip: Use the BOM (
microsphere-hibernate-dependencies) for consistent version management. See the Getting Started guide.
import io.microsphere.hibernate.test.entity.UserProfile;| Method | Description |
|---|---|
getId |
Returns the surrogate primary key of this user profile. |
setId |
Sets the surrogate primary key of this user profile. |
getIdCard |
Returns the ID card number stored in this profile. |
setIdCard |
Sets the ID card number for this profile. |
getUser |
Returns the User that owns this profile. |
setUser |
Sets the User that owns this profile. |
public Long getId()Returns the surrogate primary key of this user profile.
public void setId(Long id)Sets the surrogate primary key of this user profile.
User
This documentation was auto-generated from the source code of microsphere-hibernate.