Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Event Registration System

A JavaFX desktop application for managing event registrations with Oracle database integration using Hibernate ORM.

Features

  • 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

Prerequisites

  • Java 17 or higher
  • Oracle Database (XE version recommended)
  • Maven 3.6+

Database Setup

  1. Create an Oracle database instance
  2. Run the SQL script in db/query.sql to create tables and sample data
  3. Update database connection details in src/main/resources/hibernate.cfg.xml

Sample Data

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

Running the Application

# Compile the project
mvn clean compile

# Run the application
mvn javafx:run

Using IDE

  1. Import as Maven project
  2. Run HelloApplication.java as Java Application
  3. Or use IDE's JavaFX run configuration

Default Login Credentials

Admin Account:

  • Email: admin@test.com
  • Password: admin123

Regular User:

  • Email: bala@test.com
  • Password: bala123

πŸ“ Project Structure

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

πŸ›οΈ Architecture

MVC + Service Layer Pattern

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         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                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🎨 JavaFX Components

Core JavaFX Features Used

1. Application Class (javafx.application.Application)

  • 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();
    }
}

2. FXML Loader (javafx.fxml.FXMLLoader)

  • Loads UI from FXML markup files
  • Separates UI design from logic
  • Supports CSS-like styling

3. Scene Graph Components

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

4. UI Controls Used

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

5. Event Handling

@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);
        }
    }
}

6. Property Binding (javafx.scene.control.cell.PropertyValueFactory)

eventNameColumn.setCellValueFactory(new PropertyValueFactory<>("eventName"));
eventDateColumn.setCellValueFactory(new PropertyValueFactory<>("eventDate"));
totalSeatsColumn.setCellValueFactory(new PropertyValueFactory<>("totalSeats"));

7. Observable Collections (javafx.collections.ObservableList)

private ObservableList<Event> eventsList = FXCollections.observableArrayList();
eventsTable.setItems(eventsList);

8. CSS Styling in FXML

  • Inline styles for modern UI
  • Gradient backgrounds
  • Rounded corners and shadows
  • Hover effects

πŸ”„ Hibernate ORM Details

Hibernate Configuration

Session Factory Setup (hibernate.cfg.xml)

<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>

JPA Annotations Used

1. Entity Mapping

@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;
}

2. Column Mapping

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

3. Relationship 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;

4. Cascade Types Used

Cascade Type Description
CascadeType.ALL All operations cascade
CascadeType.PERSIST Persist operations cascade
CascadeType.MERGE Merge operations cascade
CascadeType.REMOVE Delete operations cascade

5. Fetch Strategies

Strategy Description Usage
FetchType.LAZY Load on access Large collections
FetchType.EAGER Load immediately Small collections

Hibernate Query Language (HQL)

Basic Queries

// 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();

Named Parameters

.setParameter("email", email)              // Prevents SQL injection
.setParameter("password", password)        // Type-safe binding

Session Management

public 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 Management

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;
}

πŸ“¦ Maven Configuration

Complete pom.xml Structure

<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>

Maven Commands

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

πŸ—ƒοΈ Database Schema

Entity Relationship Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   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β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Table Constraints

PARTICIPANTS

  • 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')

EVENTS

  • Primary Key: event_id
  • Check: event_name length (2-255)
  • Check: total_seats > 0
  • Check: registration_count β‰₯ 0
  • Trigger: event_date must be future

REGISTRATIONS

  • Primary Key: registration_id
  • Foreign Key: participant_id β†’ PARTICIPANTS
  • Foreign Key: event_id β†’ EVENTS
  • Unique: (participant_id, event_id)
  • Cascade: DELETE on both FKs

Database Triggers

1. Event Date Validation

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;

2. Auto-Increment Registration Count

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;

3. Auto-Decrement Registration Count

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;

4. Event Capacity Check

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;

πŸ“š API Documentation

Service Layer Methods

AuthenticationService

/**
 * 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)

RegistrationService

/**
 * 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)

Validation Methods

// 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)

πŸ“Έ Screenshots

Login Screen

  • Modern gradient background
  • Email and password fields with validation
  • Login and Sign Up buttons
  • Error/success message display

User Dashboard

  • Welcome message with user name
  • TableView of available events
  • Register/Unregister buttons
  • Real-time seat availability
  • Logout option

Admin Dashboard

  • Event management table
  • User management table
  • Create/Update/Delete event forms
  • User creation forms
  • Registration viewing

🎲 Sample Data

Default Accounts

Email Password Role Name
admin@test.com admin123 admin Administrator
bala@test.com bala123 user Bala

Sample Events

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

πŸ”§ Troubleshooting

Common Issues

1. "Could not find or load main class"

# Solution: Clean and recompile
mvn clean compile
mvn javafx:run

2. "ORA-12154: TNS:could not resolve the connect identifier"

# Solution: Check Oracle service is running
net start OracleServiceXE

# Verify connection string in hibernate.cfg.xml
jdbc:oracle:thin:@localhost:1521:xe

3. "java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver"

# Solution: Reinstall dependencies
mvn clean install -U

4. "Module org.example.eventregapp does not declare 'uses' for service"

// Solution: Check module-info.java includes:
opens org.example.eventregapp to javafx.fxml;
opens org.example.eventregapp.model to org.hibernate.orm.core;

5. Database Connection Failed

# Check Oracle listener status
lsnrctl status

# Test connection
sqlplus system/password@localhost:1521/xe

πŸš€ Future Enhancements

Planned Features

  • 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

πŸ‘₯ Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Coding Standards

  • Follow Java naming conventions
  • Add JavaDoc comments for public methods
  • Write unit tests for new features
  • Ensure code passes all existing tests

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Authors


πŸ™ Acknowledgments

  • 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

πŸ“ž Support

For support, email your.email@example.com or create an issue in this repository.


πŸ”— Links


⭐ Star this repo if you find it helpful!

Made with ❀️ for INVENTE'25

About

A JavaFX desktop application for managing event registrations with Oracle database integration using Hibernate ORM.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages