Skip to content

Commit b3cd9ed

Browse files
committed
Project renaming
1 parent 602f617 commit b3cd9ed

23 files changed

Lines changed: 83 additions & 85 deletions

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>eu.bebendorf</groupId>
8-
<artifactId>AJORM</artifactId>
7+
<groupId>org.javawebstack</groupId>
8+
<artifactId>ORM</artifactId>
99
<version>2.0</version>
1010

1111
<build>

src/main/java/eu/bebendorf/ajorm/exception/AJORMConfigurationException.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/main/java/eu/bebendorf/ajorm/Model.java renamed to src/main/java/org/javawebstack/orm/Model.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package eu.bebendorf.ajorm;
1+
package org.javawebstack.orm;
22

3-
import eu.bebendorf.ajorm.util.Helper;
3+
import org.javawebstack.orm.util.Helper;
44

55
import java.lang.reflect.Field;
66
import java.lang.reflect.InvocationTargetException;
@@ -40,39 +40,39 @@ void setEntryExists(boolean exists){
4040

4141
public void save(){
4242
try {
43-
saveMethod.invoke(AJORM.repo(getClass()), this);
43+
saveMethod.invoke(ORM.repo(getClass()), this);
4444
} catch (IllegalAccessException | InvocationTargetException e) {
4545
throw new RuntimeException(e);
4646
}
4747
}
4848

4949
public void delete(){
5050
try {
51-
deleteMethod.invoke(AJORM.repo(getClass()), this);
51+
deleteMethod.invoke(ORM.repo(getClass()), this);
5252
} catch (IllegalAccessException | InvocationTargetException e) {
5353
throw new RuntimeException(e);
5454
}
5555
}
5656

5757
public void finalDelete(){
5858
try {
59-
finalDeleteMethod.invoke(AJORM.repo(getClass()), this);
59+
finalDeleteMethod.invoke(ORM.repo(getClass()), this);
6060
} catch (IllegalAccessException | InvocationTargetException e) {
6161
throw new RuntimeException(e);
6262
}
6363
}
6464

6565
public void restore(){
6666
try {
67-
restoreMethod.invoke(AJORM.repo(getClass()), this);
67+
restoreMethod.invoke(ORM.repo(getClass()), this);
6868
} catch (IllegalAccessException | InvocationTargetException e) {
6969
throw new RuntimeException(e);
7070
}
7171
}
7272

7373
public void refresh(){
7474
try {
75-
refreshMethod.invoke(AJORM.repo(getClass()), this);
75+
refreshMethod.invoke(ORM.repo(getClass()), this);
7676
} catch (IllegalAccessException | InvocationTargetException e) {
7777
throw new RuntimeException(e);
7878
}

src/main/java/eu/bebendorf/ajorm/AJORM.java renamed to src/main/java/org/javawebstack/orm/ORM.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
package eu.bebendorf.ajorm;
1+
package org.javawebstack.orm;
22

3-
import eu.bebendorf.ajorm.exception.AJORMConfigurationException;
4-
import eu.bebendorf.ajorm.wrapper.SQL;
3+
import org.javawebstack.orm.exception.ORMConfigurationException;
4+
import org.javawebstack.orm.wrapper.SQL;
55

66
import java.util.HashMap;
77
import java.util.Map;
88

9-
public class AJORM {
9+
public class ORM {
1010

1111
private static Map<Class<?>, Repo<?>> repositories = new HashMap<>();
1212

1313
public static <T extends Model> Repo<T> repo(Class<T> model){
1414
return (Repo<T>) repositories.get(model);
1515
}
1616

17-
public static <T extends Model> Repo<T> register(Class<T> model, SQL sql, AJORMConfig config) throws AJORMConfigurationException {
17+
public static <T extends Model> Repo<T> register(Class<T> model, SQL sql, ORMConfig config) throws ORMConfigurationException {
1818
Repo<T> repo = new Repo<>(model, sql, config);
1919
repositories.put(model, repo);
2020
return repo;
2121
}
2222

23-
public static <T extends Model> Repo<T> register(Class<T> model, SQL sql) throws AJORMConfigurationException {
24-
return register(model, sql, new AJORMConfig());
23+
public static <T extends Model> Repo<T> register(Class<T> model, SQL sql) throws ORMConfigurationException {
24+
return register(model, sql, new ORMConfig());
2525
}
2626

27-
public static <T extends Model> Repo<T> registerAndMigrate(Class<T> model, SQL sql, AJORMConfig config) throws AJORMConfigurationException {
27+
public static <T extends Model> Repo<T> registerAndMigrate(Class<T> model, SQL sql, ORMConfig config) throws ORMConfigurationException {
2828
Repo<T> repo = new Repo<>(model, sql, config);
2929
repo.migrate();
3030
repositories.put(model, repo);
3131
return repo;
3232
}
3333

34-
public static <T extends Model> Repo<T> registerAndMigrate(Class<T> model, SQL sql) throws AJORMConfigurationException {
35-
return registerAndMigrate(model, sql, new AJORMConfig());
34+
public static <T extends Model> Repo<T> registerAndMigrate(Class<T> model, SQL sql) throws ORMConfigurationException {
35+
return registerAndMigrate(model, sql, new ORMConfig());
3636
}
3737

3838
public static void unregister(Class<? extends Model> model){

src/main/java/eu/bebendorf/ajorm/AJORMConfig.java renamed to src/main/java/org/javawebstack/orm/ORMConfig.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
package eu.bebendorf.ajorm;
1+
package org.javawebstack.orm;
22

3-
import eu.bebendorf.ajorm.mapper.DefaultMapper;
4-
import eu.bebendorf.ajorm.mapper.TypeMapper;
3+
import org.javawebstack.orm.mapper.DefaultMapper;
4+
import org.javawebstack.orm.mapper.TypeMapper;
55

66
import java.util.ArrayList;
77
import java.util.List;
88

9-
public class AJORMConfig {
9+
public class ORMConfig {
1010
private String tablePrefix = "";
1111
private boolean camelToSnakeCase = true;
1212
private int defaultSize = 0;
1313
private boolean idPrimaryKey = true;
1414
private List<TypeMapper> typeMappers = new ArrayList<>();
1515
private boolean debugMode = false;
16-
public AJORMConfig(){
16+
public ORMConfig(){
1717
typeMappers.add(new DefaultMapper());
1818
}
19-
public AJORMConfig setTablePrefix(String tablePrefix){
19+
public ORMConfig setTablePrefix(String tablePrefix){
2020
this.tablePrefix = tablePrefix;
2121
return this;
2222
}
23-
public AJORMConfig setCamelToSnakeCase(boolean camelToSnakeCase){
23+
public ORMConfig setCamelToSnakeCase(boolean camelToSnakeCase){
2424
this.camelToSnakeCase = camelToSnakeCase;
2525
return this;
2626
}
27-
public AJORMConfig setDefaultSize(int defaultSize){
27+
public ORMConfig setDefaultSize(int defaultSize){
2828
this.defaultSize = defaultSize;
2929
return this;
3030
}
31-
public AJORMConfig addTypeMapper(TypeMapper typeMapper){
31+
public ORMConfig addTypeMapper(TypeMapper typeMapper){
3232
typeMappers.add(typeMapper);
3333
return this;
3434
}
35-
public AJORMConfig setIdPrimaryKey(boolean idPrimaryKey){
35+
public ORMConfig setIdPrimaryKey(boolean idPrimaryKey){
3636
this.idPrimaryKey = idPrimaryKey;
3737
return this;
3838
}

src/main/java/eu/bebendorf/ajorm/Observer.java renamed to src/main/java/org/javawebstack/orm/Observer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package eu.bebendorf.ajorm;
1+
package org.javawebstack.orm;
22

33
public interface Observer<T extends Model> {
44

src/main/java/eu/bebendorf/ajorm/QueryBuilder.java renamed to src/main/java/org/javawebstack/orm/QueryBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package eu.bebendorf.ajorm;
1+
package org.javawebstack.orm;
22

3-
import eu.bebendorf.ajorm.mapper.TypeMapper;
3+
import org.javawebstack.orm.mapper.TypeMapper;
44

55
import java.lang.reflect.InvocationTargetException;
66
import java.sql.ResultSet;

src/main/java/eu/bebendorf/ajorm/Repo.java renamed to src/main/java/org/javawebstack/orm/Repo.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package eu.bebendorf.ajorm;
1+
package org.javawebstack.orm;
22

3-
import eu.bebendorf.ajorm.exception.AJORMConfigurationException;
4-
import eu.bebendorf.ajorm.util.MigrationTool;
5-
import eu.bebendorf.ajorm.wrapper.SQL;
3+
import org.javawebstack.orm.exception.ORMConfigurationException;
4+
import org.javawebstack.orm.util.MigrationTool;
5+
import org.javawebstack.orm.wrapper.SQL;
66

77
import java.sql.Timestamp;
88
import java.util.ArrayList;
@@ -12,14 +12,14 @@
1212
public class Repo<T extends Model> {
1313

1414
public static <T extends Model> Repo<T> get(Class<T> model){
15-
return AJORM.repo(model);
15+
return ORM.repo(model);
1616
}
1717

1818
private final TableInfo info;
1919
private SQL connection;
2020
private List<Observer<T>> observers = new ArrayList<>();
2121

22-
public Repo(Class<T> clazz, SQL connection, AJORMConfig config) throws AJORMConfigurationException {
22+
public Repo(Class<T> clazz, SQL connection, ORMConfig config) throws ORMConfigurationException {
2323
this.info = new TableInfo(clazz, config);
2424
this.connection = connection;
2525
}

src/main/java/eu/bebendorf/ajorm/TableInfo.java renamed to src/main/java/org/javawebstack/orm/TableInfo.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
package eu.bebendorf.ajorm;
2-
3-
import eu.bebendorf.ajorm.annotation.Column;
4-
import eu.bebendorf.ajorm.annotation.Dates;
5-
import eu.bebendorf.ajorm.annotation.SoftDelete;
6-
import eu.bebendorf.ajorm.annotation.Table;
7-
import eu.bebendorf.ajorm.exception.AJORMConfigurationException;
8-
import eu.bebendorf.ajorm.mapper.DefaultMapper;
9-
import eu.bebendorf.ajorm.mapper.TypeMapper;
10-
import eu.bebendorf.ajorm.util.Helper;
11-
import eu.bebendorf.ajorm.util.KeyType;
1+
package org.javawebstack.orm;
2+
3+
import org.javawebstack.orm.annotation.Column;
4+
import org.javawebstack.orm.annotation.Dates;
5+
import org.javawebstack.orm.annotation.SoftDelete;
6+
import org.javawebstack.orm.annotation.Table;
7+
import org.javawebstack.orm.exception.ORMConfigurationException;
8+
import org.javawebstack.orm.mapper.DefaultMapper;
9+
import org.javawebstack.orm.mapper.TypeMapper;
10+
import org.javawebstack.orm.util.Helper;
11+
import org.javawebstack.orm.util.KeyType;
1212

1313
import java.lang.reflect.Constructor;
1414
import java.lang.reflect.Field;
@@ -27,15 +27,15 @@ public class TableInfo {
2727
private final Map<String, String> fieldToColumn = new HashMap<>();
2828
private final Map<String, Column> fieldConfigs = new HashMap<>();
2929
private final Map<String, Class<?>> sqlTypes = new HashMap<>();
30-
private final AJORMConfig config;
30+
private final ORMConfig config;
3131
private SoftDelete softDelete;
3232
private Dates dates;
3333
private final Class<? extends Model> modelClass;
3434
private String primaryKey;
3535
private final List<String> uniqueKeys = new ArrayList<>();
3636
private final Constructor<?> constructor;
3737

38-
public TableInfo(Class<? extends Model> model, AJORMConfig config) throws AJORMConfigurationException {
38+
public TableInfo(Class<? extends Model> model, ORMConfig config) throws ORMConfigurationException {
3939
this.config = config;
4040
this.modelClass = model;
4141
if(model.isAnnotationPresent(Table.class)){
@@ -48,7 +48,7 @@ public TableInfo(Class<? extends Model> model, AJORMConfig config) throws AJORMC
4848
constructor = model.getConstructor();
4949
constructor.setAccessible(true);
5050
} catch (NoSuchMethodException e) {
51-
throw new AJORMConfigurationException("The model class has no empty constructor!");
51+
throw new ORMConfigurationException("The model class has no empty constructor!");
5252
}
5353
for(Field field : model.getDeclaredFields()){
5454
if(Modifier.isStatic(field.getModifiers()))
@@ -74,13 +74,13 @@ public TableInfo(Class<? extends Model> model, AJORMConfig config) throws AJORMC
7474
}
7575
}
7676
if(!sqlTypes.containsKey(fieldName))
77-
throw new AJORMConfigurationException("Couldn't find type-mapper for '"+fieldName+"'!");
77+
throw new ORMConfigurationException("Couldn't find type-mapper for '"+fieldName+"'!");
7878
if(fieldConfig.id()) {
7979
idField = fieldName;
8080
}
8181
if(fieldConfig.key() == KeyType.PRIMARY){
8282
if(primaryKey != null && !primaryKey.equals(fieldName))
83-
throw new AJORMConfigurationException("Multiple primary key fields!");
83+
throw new ORMConfigurationException("Multiple primary key fields!");
8484
primaryKey = fieldName;
8585
}
8686
if(fieldConfig.key() == KeyType.UNIQUE)
@@ -89,22 +89,22 @@ public TableInfo(Class<? extends Model> model, AJORMConfig config) throws AJORMC
8989
if(!fields.containsKey(idField))
9090
idField = "uuid";
9191
if(!fields.containsKey(idField))
92-
throw new AJORMConfigurationException("No id field found!");
92+
throw new ORMConfigurationException("No id field found!");
9393
if(config.isIdPrimaryKey()){
9494
if(primaryKey == null)
9595
primaryKey = idField;
9696
}
9797
if(model.isAnnotationPresent(SoftDelete.class)){
9898
softDelete = model.getDeclaredAnnotationsByType(SoftDelete.class)[0];
9999
if(!fields.containsKey(softDelete.value()))
100-
throw new AJORMConfigurationException("Missing soft-delete field '"+softDelete.value()+"'");
100+
throw new ORMConfigurationException("Missing soft-delete field '"+softDelete.value()+"'");
101101
}
102102
if(model.isAnnotationPresent(Dates.class)){
103103
dates = model.getDeclaredAnnotationsByType(Dates.class)[0];
104104
if(!fields.containsKey(dates.create()))
105-
throw new AJORMConfigurationException("Missing dates field '"+dates.create()+"'");
105+
throw new ORMConfigurationException("Missing dates field '"+dates.create()+"'");
106106
if(!fields.containsKey(dates.update()))
107-
throw new AJORMConfigurationException("Missing dates field '"+dates.update()+"'");
107+
throw new ORMConfigurationException("Missing dates field '"+dates.update()+"'");
108108
}
109109
}
110110

@@ -180,7 +180,7 @@ public Class<? extends Model> getModelClass(){
180180
return modelClass;
181181
}
182182

183-
public AJORMConfig getConfig(){
183+
public ORMConfig getConfig(){
184184
return config;
185185
}
186186

src/main/java/eu/bebendorf/ajorm/annotation/Column.java renamed to src/main/java/org/javawebstack/orm/annotation/Column.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package eu.bebendorf.ajorm.annotation;
1+
package org.javawebstack.orm.annotation;
22

3-
import eu.bebendorf.ajorm.util.KeyType;
3+
import org.javawebstack.orm.util.KeyType;
44

55
import java.lang.annotation.ElementType;
66
import java.lang.annotation.Retention;

0 commit comments

Comments
 (0)