Skip to content

A simple ORM similar to Hibernate for generating MySQL-like queries, developed using annotations and aspects.

Notifications You must be signed in to change notification settings

stefanGT44/Object-Relational-Mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ObjectRelationalMapper

Overview

A simple ORM, influenced by Hibernate and the Django ORM, for generating MySQL-like queries, developed using annotations, aspects and the Java reflect package.

Details

Entities must have the @Table(), and attributes the @Column() annotation.
Before saving entities and adding elements to manyToMany relationships, aspectJ methods intercept the call and perform validation.
An entity must have strictly one @ID field.
@ManyToMany fields must be of type ArrayList<T>, and elements being added are checked for type compatibility (T).

Supported annotations:

  • @Table(name)
  • @Column(name, required, notNull)
  • @Id
  • @IntegerField
  • @CharField(maxLength)
  • @MappedSuperclass
  • @ForeignKey
  • @ManyToMany

Example

Defined entities:

Alt text

Alt text

Alt text

Alt text

Saving (inserting) entities:

Alt text

Console output:

Alt text

Sidenote

This project was an assignment as part of the course - Advanced Java programming during the 7th semester at the Faculty of Computer Science in Belgrade.

Contributors

About

A simple ORM similar to Hibernate for generating MySQL-like queries, developed using annotations and aspects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published