A JavaFX desktop application for managing event registrations with Oracle database integration using Hibernate ORM.
- User Authentication: Login system with email/password
- Event Management: View available events with seat availability
- Registration System: Register/unregister for events
- User Dashboard: View personal registrations
- Database Integration: Oracle database with Hibernate ORM
- Java 17 or higher
- Oracle Database (XE version recommended)
- Maven 3.6+
- Create an Oracle database instance
- Run the SQL script in
db/query.sqlto create tables and sample data - Update database connection details in
src/main/resources/hibernate.cfg.xml
The application comes with sample data:
- Admin User: admin@test.com / adminpass
- Regular User: john.doe@test.com / userpass
- Sample Events: JavaFX Workshop, Hibernate for Beginners, Oracle SQL Masterclass
# Compile the project
mvn clean compile
# Run the application
mvn javafx:run- Import as Maven project
- Run
HelloApplication.javaas Java Application - Or use IDE's JavaFX run configuration
Admin Account:
- Email:
admin@test.com - Password:
admin123
Regular User:
- Email:
bala@test.com - Password:
bala123
EventRegApp/
β
βββ π src/main/
β βββ π java/org/example/eventregapp/
β β β
β β βββ π model/ # Entity Layer
β β β βββ Participant.java # User entity
β β β βββ Event.java # Event entity
β β β βββ Registration.java # Registration entity
β β β
β β βββ π service/ # Business Logic Layer
β β β βββ AuthenticationService.java # Login/auth operations
β β β βββ RegistrationService.java # Registration operations
β β β
β β βββ π util/ # Utility Layer
β β β βββ DatabaseUtil.java # Hibernate session factory
β β β βββ DataInitializer.java # Initial data setup
β β β βββ ValidationUtil.java # Input validation
β β β βββ LoginTest.java # Connection testing
β β β
β β βββ π controllers/ # Controller Layer
β β β βββ HelloApplication.java # Main entry point
β β β βββ LoginController.java # Login/signup handler
β β β βββ AdminController.java # Admin panel logic
β β β βββ UserController.java # User panel logic
β β β βββ HelloController.java # Base controller
β β β βββ RegistrationController.java # Registration view
β β β
β β βββ module-info.java # Java module descriptor
β β
β βββ π resources/
β βββ hibernate.cfg.xml # Hibernate configuration
β β
β βββ π org/example/eventregapp/ # FXML Views
β βββ login-view.fxml # Login screen UI
β βββ admin-view.fxml # Admin dashboard UI
β βββ user-view.fxml # User dashboard UI
β βββ registration-view.fxml # Registration view UI
β βββ hello-view.fxml # Base view
β
βββ π db/
β βββ query.sql # Database schema & data
β
βββ π target/ # Compiled output (ignored)
β
βββ pom.xml # Maven configuration
βββ .gitignore # Git ignore rules
βββ README.md # This file
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VIEW LAYER β
β (FXML Files + JavaFX Controllers) β
β login-view.fxml β LoginController.java β
β admin-view.fxml β AdminController.java β
β user-view.fxml β UserController.java β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CONTROLLER LAYER β
β (Event Handlers) β
β - Handle user input β
β - Call service methods β
β - Update views β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SERVICE LAYER β
β (Business Logic) β
β AuthenticationService: Login, role checking β
β RegistrationService: Registration operations β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MODEL LAYER β
β (Entity Classes) β
β Participant.java (User/Admin) β
β Event.java (Events) β
β Registration.java (Registrations) β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PERSISTENCE LAYER β
β (Hibernate ORM + DatabaseUtil) β
β - Session management β
β - Transaction handling β
β - HQL query execution β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATABASE LAYER β
β (Oracle Database XE) β
β Tables: PARTICIPANTS, EVENTS, REGISTRATIONS β
β Triggers: Data integrity automation β
β Sequences: Primary key generation β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Entry point for JavaFX applications
- Manages application lifecycle
- Scene and stage initialization
public class HelloApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(
HelloApplication.class.getResource("login-view.fxml")
);
Scene scene = new Scene(fxmlLoader.load(), 700, 650);
stage.setTitle("INVENTE'25 | SSN College of Engineering");
stage.setScene(scene);
stage.show();
}
}- Loads UI from FXML markup files
- Separates UI design from logic
- Supports CSS-like styling
| Component | Purpose | Usage in Project |
|---|---|---|
Scene |
Container for all UI elements | Main window container |
Stage |
Top-level window | Application window |
BorderPane |
Layout with 5 regions | Login screen layout |
VBox |
Vertical box layout | Form layouts |
HBox |
Horizontal box layout | Button groups |
TableView<T> |
Data table display | Event and user lists |
TableColumn<S,T> |
Table columns | Event properties |
| Control | Description | Implementation |
|---|---|---|
TextField |
Single-line text input | Email input |
PasswordField |
Masked password input | Password entry |
Button |
Clickable button | Login, Register, etc. |
Label |
Text display | Headers, messages |
DatePicker |
Date selection | Event date input |
TableView |
Data grid | Event/user listings |
ComboBox |
Dropdown selection | Role selection |
@FXML
private void handleLogin() {
String email = emailField.getText();
String password = passwordField.getText();
Participant participant = AuthenticationService.authenticate(email, password);
if (participant != null) {
if (AuthenticationService.isAdmin(participant)) {
redirectToAdminPanel(participant);
} else {
redirectToUserPanel(participant);
}
}
}eventNameColumn.setCellValueFactory(new PropertyValueFactory<>("eventName"));
eventDateColumn.setCellValueFactory(new PropertyValueFactory<>("eventDate"));
totalSeatsColumn.setCellValueFactory(new PropertyValueFactory<>("totalSeats"));private ObservableList<Event> eventsList = FXCollections.observableArrayList();
eventsTable.setItems(eventsList);- Inline styles for modern UI
- Gradient backgrounds
- Rounded corners and shadows
- Hover effects
<hibernate-configuration>
<session-factory>
<!-- Connection Settings -->
<property name="connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="connection.url">
jdbc:oracle:thin:@localhost:1521:xe
</property>
<!-- Hibernate Settings -->
<property name="dialect">
org.hibernate.dialect.Oracle12cDialect
</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="hbm2ddl.auto">update</property>
<!-- Connection Pooling (C3P0) -->
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<!-- Entity Mappings -->
<mapping class="org.example.eventregapp.model.Participant"/>
<mapping class="org.example.eventregapp.model.Event"/>
<mapping class="org.example.eventregapp.model.Registration"/>
</session-factory>
</hibernate-configuration>@Entity // Marks class as entity
@Table(name = "PARTICIPANTS") // Maps to database table
public class Participant {
@Id // Primary key
@GeneratedValue( // Auto-generation strategy
strategy = GenerationType.SEQUENCE,
generator = "participants_seq"
)
@SequenceGenerator( // Sequence configuration
name = "participants_seq",
sequenceName = "participants_seq",
allocationSize = 1
)
@Column(name = "participant_id") // Column mapping
private Long participantId;
}| Annotation | Purpose | Example |
|---|---|---|
@Column |
Map field to column | @Column(name = "full_name", nullable = false) |
@Id |
Primary key | @Id on Long id field |
@GeneratedValue |
Auto-generation | strategy = GenerationType.SEQUENCE |
@SequenceGenerator |
Sequence config | Oracle sequence mapping |
One-to-Many (Participant β Registrations):
@OneToMany(
mappedBy = "participant", // Owning side field
cascade = CascadeType.ALL, // Cascade operations
fetch = FetchType.LAZY // Lazy loading
)
private Set<Registration> registrations = new HashSet<>();Many-to-One (Registration β Participant):
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(
name = "participant_id", // Foreign key column
nullable = false // NOT NULL constraint
)
private Participant participant;| Cascade Type | Description |
|---|---|
CascadeType.ALL |
All operations cascade |
CascadeType.PERSIST |
Persist operations cascade |
CascadeType.MERGE |
Merge operations cascade |
CascadeType.REMOVE |
Delete operations cascade |
| Strategy | Description | Usage |
|---|---|---|
FetchType.LAZY |
Load on access | Large collections |
FetchType.EAGER |
Load immediately | Small collections |
// Simple query
session.createQuery("FROM Participant WHERE role = :role", Participant.class)
.setParameter("role", "admin")
.list();
// Join query
session.createQuery(
"SELECT r FROM Registration r " +
"JOIN FETCH r.participant p " +
"JOIN FETCH r.event e " +
"WHERE r.event = :event",
Registration.class
).setParameter("event", event).list();.setParameter("email", email) // Prevents SQL injection
.setParameter("password", password) // Type-safe bindingpublic static Session getSession() {
return sessionFactory.openSession();
}
// Try-with-resources for auto-close
try (Session session = DatabaseUtil.getSession()) {
Transaction transaction = session.beginTransaction();
// Operations here
transaction.commit();
} catch (Exception e) {
transaction.rollback();
}Transaction transaction = session.beginTransaction();
try {
session.save(entity); // Insert
session.update(entity); // Update
session.delete(entity); // Delete
transaction.commit(); // Commit changes
} catch (Exception e) {
transaction.rollback(); // Rollback on error
throw e;
}<project>
<modelVersion>4.0.0</modelVersion>
<!-- Project Coordinates -->
<groupId>org.example</groupId>
<artifactId>EventRegApp</artifactId>
<version>1.0-SNAPSHOT</version>
<name>EventRegApp</name>
<!-- Properties -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.10.2</junit.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<!-- Dependencies -->
<dependencies>
<!-- JavaFX Dependencies -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>17.0.2</version>
</dependency>
<!-- Hibernate ORM -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.6.15.Final</version>
</dependency>
<!-- Oracle JDBC Driver -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.3.0.0</version>
</dependency>
<!-- JUnit Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<!-- Build Configuration -->
<build>
<plugins>
<!-- Compiler Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<!-- JavaFX Plugin -->
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>org.example.eventregapp.HelloApplication</mainClass>
</configuration>
</plugin>
<!-- Exec Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
</plugin>
</plugins>
</build>
</project>| Command | Purpose |
|---|---|
mvn clean |
Delete target directory |
mvn compile |
Compile source code |
mvn test |
Run unit tests |
mvn package |
Create JAR file |
mvn install |
Install to local repository |
mvn javafx:run |
Run JavaFX application |
mvn dependency:tree |
Show dependency tree |
βββββββββββββββββββββββ
β PARTICIPANTS β
βββββββββββββββββββββββ€
β PK participant_id β
β full_name β
β email (UNIQUE) β
β password β
β role β
ββββββββββββ¬βββββββββββ
β 1
β
β N
ββββββββββββΌβββββββββββ
β REGISTRATIONS β
βββββββββββββββββββββββ€
β PK registration_id β
β FK participant_id β
β FK event_id β
β registration_dateβ
ββββββββββββ¬βββββββββββ
β N
β
β 1
ββββββββββββΌβββββββββββ
β EVENTS β
βββββββββββββββββββββββ€
β PK event_id β
β event_name β
β event_date β
β total_seats β
β registration_countβ
βββββββββββββββββββββββ
- Primary Key: participant_id
- Unique: email
- Check: full_name length (2-50)
- Check: email format (regex)
- Check: password length (β₯6)
- Check: role IN ('admin', 'user')
- Primary Key: event_id
- Check: event_name length (2-255)
- Check: total_seats > 0
- Check: registration_count β₯ 0
- Trigger: event_date must be future
- Primary Key: registration_id
- Foreign Key: participant_id β PARTICIPANTS
- Foreign Key: event_id β EVENTS
- Unique: (participant_id, event_id)
- Cascade: DELETE on both FKs
CREATE OR REPLACE TRIGGER trg_check_event_date
BEFORE INSERT OR UPDATE ON EVENTS
FOR EACH ROW
BEGIN
IF :NEW.event_date <= TRUNC(SYSDATE) THEN
RAISE_APPLICATION_ERROR(-20001,
'Error: Event date must be in the future.');
END IF;
END;CREATE OR REPLACE TRIGGER trg_inc_reg_count
AFTER INSERT ON REGISTRATIONS
FOR EACH ROW
BEGIN
UPDATE EVENTS
SET registration_count = registration_count + 1
WHERE event_id = :NEW.event_id;
END;CREATE OR REPLACE TRIGGER trg_dec_reg_count
AFTER DELETE ON REGISTRATIONS
FOR EACH ROW
BEGIN
UPDATE EVENTS
SET registration_count = registration_count - 1
WHERE event_id = :OLD.event_id;
END;CREATE OR REPLACE TRIGGER trg_check_event_capacity
BEFORE INSERT ON REGISTRATIONS
FOR EACH ROW
DECLARE
v_total_seats NUMBER;
v_registration_count NUMBER;
BEGIN
SELECT total_seats, registration_count
INTO v_total_seats, v_registration_count
FROM EVENTS
WHERE event_id = :NEW.event_id;
IF v_registration_count >= v_total_seats THEN
RAISE_APPLICATION_ERROR(-20002,
'Error: Event is full. Cannot register more participants.');
END IF;
END;/**
* Authenticate user with email and password
* @param email User email
* @param password User password
* @return Participant object if successful, null otherwise
*/
public static Participant authenticate(String email, String password)
/**
* Check if participant has admin role
* @param participant Participant to check
* @return true if admin, false otherwise
*/
public static boolean isAdmin(Participant participant)
/**
* Check if participant has user role
* @param participant Participant to check
* @return true if user, false otherwise
*/
public static boolean isUser(Participant participant)
/**
* Get user role
* @param participant Participant
* @return Role string (admin/user)
*/
public static String getUserRole(Participant participant)/**
* Register participant for event with validation
* @param participant Participant to register
* @param event Event to register for
* @return Success/error message
*/
public static String registerForEvent(Participant participant, Event event)
/**
* Check if user is registered for event
* @param participant Participant to check
* @param event Event to check
* @return true if registered, false otherwise
*/
public static boolean isUserRegisteredForEvent(Participant participant, Event event)
/**
* Remove registration (unregister)
* @param participant Participant
* @param event Event
* @return Success/error message
*/
public static String removeRegistration(Participant participant, Event event)
/**
* Get all registrations for an event
* @param event Event
* @return List of registrations
*/
public static List<Registration> getEventRegistrations(Event event)
/**
* Get all registrations for a participant
* @param participant Participant
* @return List of registrations
*/
public static List<Registration> getParticipantRegistrations(Participant participant)// Email validation
public static boolean isValidEmail(String email)
// Name validation (2-50 chars, letters/spaces/hyphens)
public static boolean isValidName(String name)
// Password validation (min 6 chars, letter + number)
public static boolean isValidPassword(String password)
// Future date validation
public static boolean isValidFutureDate(String dateStr)
// Positive number validation
public static boolean isValidPositiveNumber(String numberStr)- Modern gradient background
- Email and password fields with validation
- Login and Sign Up buttons
- Error/success message display
- Welcome message with user name
- TableView of available events
- Register/Unregister buttons
- Real-time seat availability
- Logout option
- Event management table
- User management table
- Create/Update/Delete event forms
- User creation forms
- Registration viewing
| Password | Role | Name | |
|---|---|---|---|
| admin@test.com | admin123 | admin | Administrator |
| bala@test.com | bala123 | user | Bala |
| Event Name | Date | Total Seats |
|---|---|---|
| JavaFX Workshop | 2025-12-15 | 50 |
| Hibernate for Beginners | 2025-12-20 | 30 |
| Oracle SQL Masterclass | 2026-01-05 | 10 |
| Spring Boot Advanced | 2026-01-10 | 25 |
| Microservices Architecture | 2026-01-15 | 40 |
# Solution: Clean and recompile
mvn clean compile
mvn javafx:run# Solution: Check Oracle service is running
net start OracleServiceXE
# Verify connection string in hibernate.cfg.xml
jdbc:oracle:thin:@localhost:1521:xe# Solution: Reinstall dependencies
mvn clean install -U// Solution: Check module-info.java includes:
opens org.example.eventregapp to javafx.fxml;
opens org.example.eventregapp.model to org.hibernate.orm.core;# Check Oracle listener status
lsnrctl status
# Test connection
sqlplus system/password@localhost:1521/xe- Email Notifications - Send confirmation emails for registrations
- Password Encryption - BCrypt/Argon2 password hashing
- Export Functionality - Export registration lists to PDF/Excel
- Search & Filter - Advanced event search and filtering
- Event Categories - Categorize events (Workshop, Seminar, etc.)
- Waiting List - Queue system for full events
- Profile Pictures - User avatar uploads
- Event Images - Add event banners/posters
- Calendar View - Calendar-based event browsing
- Reports & Analytics - Registration statistics and charts
- Multi-language Support - Internationalization (i18n)
- Dark Mode - Theme switching capability
- Audit Logging - Track all user actions
- REST API - Web service endpoints
- Mobile App - Android/iOS companion app
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow Java naming conventions
- Add JavaDoc comments for public methods
- Write unit tests for new features
- Ensure code passes all existing tests
This project is licensed under the MIT License - see the LICENSE file for details.
- Your Name - Initial work - @yourusername
- SSN College of Engineering - For INVENTE'25 event
- Oracle Corporation - Oracle Database
- Hibernate Team - Hibernate ORM framework
- OpenJFX Community - JavaFX framework
- Apache Maven - Build automation
For support, email your.email@example.com or create an issue in this repository.
β Star this repo if you find it helpful!
Made with β€οΈ for INVENTE'25