Skip to content

Commit

Permalink
jvfs daogen model is not set to next generation (not serializable)
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Mar 12, 2024
1 parent b7ab43e commit 131ade1
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 66 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- jvfs daogen model is not set to next generation (not serializable)
- fj-daogen-version set to 1.7.9

## [8.5.3] - 2024-03-08
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.fugerit.java.core.jvfs.db.daogen.def.facade;

import org.fugerit.java.core.db.daogen.BaseIdFinder;
import org.fugerit.java.core.db.daogen.IdFinderNG;
import org.fugerit.java.core.jvfs.db.daogen.model.ModelDbJvfsFile;

// custom import start ( code above here will be overwritten )
Expand All @@ -15,30 +15,11 @@
* // custom code start ( code above here will be overwritten )
* // custom code end ( code below here will be overwritten )
*/
public class DbJvfsFileFinder extends BaseIdFinder {
public class DbJvfsFileFinder extends IdFinderNG {

// custom code start ( code above here will be overwritten )

// code added to setup a basic conditional serialization - START

private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
// this class is conditionally serializable, depending on contained object
// you are encouraged to handle special situation using this method
out.defaultWriteObject();
}

private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
// this class is conditionally serializable, depending on contained object
// you are encouraged to handle special situation using this method
in.defaultReadObject();
}

// code added to setup a basic conditional serialization - END

// custom code end ( code below here will be overwritten )

private static final long serialVersionUID = 4317877389001250786L;

private ModelDbJvfsFile model;

public void setModel( ModelDbJvfsFile model ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.fugerit.java.core.jvfs.db.daogen.helper;

import org.fugerit.java.core.db.daogen.BasicHelper;
import org.fugerit.java.core.jvfs.db.daogen.model.ModelDbJvfsFile;

// custom import start ( code above here will be overwritten )
Expand All @@ -15,30 +14,11 @@
* // custom code start ( code above here will be overwritten )
* // custom code end ( code below here will be overwritten )
*/
public class HelperDbJvfsFile extends BasicHelper implements ModelDbJvfsFile {
public class HelperDbJvfsFile implements ModelDbJvfsFile {

// custom code start ( code above here will be overwritten )

// code added to setup a basic conditional serialization - START

private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
// this class is conditionally serializable, depending on contained object
// you are encouraged to handle special situation using this method
out.defaultWriteObject();
}

private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
// this class is conditionally serializable, depending on contained object
// you are encouraged to handle special situation using this method
in.defaultReadObject();
}

// code added to setup a basic conditional serialization - END

// custom code end ( code below here will be overwritten )

private static final long serialVersionUID = 405195931944L;

/*
* fields generated for entity attributes
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.fugerit.java.core.jvfs.db.daogen.helper;

import org.fugerit.java.core.db.daogen.BasicWrapper;
import org.fugerit.java.core.db.daogen.BasicWrapperNG;
import org.fugerit.java.core.jvfs.db.daogen.model.ModelDbJvfsFile;

// custom import start ( code above here will be overwritten )
Expand All @@ -15,30 +15,11 @@
* // custom code start ( code above here will be overwritten )
* // custom code end ( code below here will be overwritten )
*/
public class WrapperDbJvfsFile extends BasicWrapper<ModelDbJvfsFile> implements ModelDbJvfsFile {
public class WrapperDbJvfsFile extends BasicWrapperNG<ModelDbJvfsFile> implements ModelDbJvfsFile {

// custom code start ( code above here will be overwritten )

// code added to setup a basic conditional serialization - START

private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
// this class is conditionally serializable, depending on contained object
// you are encouraged to handle special situation using this method
out.defaultWriteObject();
}

private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
// this class is conditionally serializable, depending on contained object
// you are encouraged to handle special situation using this method
in.defaultReadObject();
}

// code added to setup a basic conditional serialization - END

// custom code end ( code below here will be overwritten )

private static final long serialVersionUID = 727138411484L;

public WrapperDbJvfsFile( ModelDbJvfsFile wrapped ) {
super( wrapped );
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package org.fugerit.java.core.jvfs.db.daogen.junit4test.model;

import org.fugerit.java.core.jvfs.db.daogen.helper.HelperDbJvfsFile;
import org.fugerit.java.core.jvfs.db.daogen.helper.WrapperDbJvfsFile;
import org.fugerit.java.core.jvfs.db.daogen.model.ModelDbJvfsFile;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

// custom import start ( code above here will be overwritten )
// custom import end ( code below here will be overwritten )

/**
* DbJvfsFileJunit4ModelTest, version : 1.0.0
*
* author: fugerit
*
* warning!: auto generated object, insert custom code only between comments :
* // custom code start ( code above here will be overwritten )
* // custom code end ( code below here will be overwritten )
*/
public class DbJvfsFileJunit4ModelTest {

// custom code start ( code above here will be overwritten )
// custom code end ( code below here will be overwritten )

private static final Logger logger = LoggerFactory.getLogger( DbJvfsFileJunit4ModelTest.class );

public void printAll( ModelDbJvfsFile current ) {
logger.info( "FILE_NAME-> {}", current.getFileName() );
logger.info( "PARENT_PATH-> {}", current.getParentPath() );
logger.info( "FILE_PROPS-> {}", current.getFileProps() );
logger.info( "CREATION_TIME-> {}", current.getCreationTime() );
logger.info( "UPDATE_TIME-> {}", current.getUpdateTime() );
logger.info( "FILE_SIZE-> {}", current.getFileSize() );
logger.info( "FILE_CONTENT-> {}", current.getFileContent() );
}

public ModelDbJvfsFile newInstance() {
WrapperDbJvfsFile current = new WrapperDbJvfsFile( new HelperDbJvfsFile() );
Assert.assertTrue( current.isEmpty() );
current.setFileName("1");
Assert.assertFalse( current.isEmpty() );
current.setParentPath("1");
Assert.assertFalse( current.isEmpty() );
current.setFileProps("1");
Assert.assertFalse( current.isEmpty() );
current.setCreationTime(new java.util.Date());
Assert.assertFalse( current.isEmpty() );
current.setUpdateTime(new java.util.Date());
Assert.assertFalse( current.isEmpty() );
current.setFileSize(new java.math.BigDecimal( "1" ));
Assert.assertFalse( current.isEmpty() );
current.setFileContent(null);
Assert.assertFalse( current.isEmpty() );
logger.info( "unwrap : {}", current.unwrap( current ) );
return current;
}

@Test
public void testJUnit4ModelDbJvfsFile() {
ModelDbJvfsFile current = this.newInstance();
this.printAll( current );
logger.info( "current toString() : {}", current );
Assert.assertNotNull( current );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public void testInitMemDB() {
WrapperDbJvfsFile wrapper = new WrapperDbJvfsFile( new HelperDbJvfsFile() );
log.info( "toString() : {}", wrapper );
log.info( "isEmpty() : {}", wrapper.isEmpty() );
log.info( "setTest1() : {}", this.fullSerializationTest( wrapper ) );
log.info( "setTest2() : {}", this.fullSerializationTest( wrapper.unwrap() ) );
} catch (Exception e) {
failEx(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void testFinder() throws IOException {
DbJvfsFileFinder finder = new DbJvfsFileFinder();
finder.setModel( new HelperDbJvfsFile() );
log.info( "log -> {}", DbJvfsFileFinder.newInstance( finder.getModel() ) );
Assert.assertNotNull( this.fullSerializationTest( finder ) );
Assert.assertNotNull( finder );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
package-facade-data-impl="org.fugerit.java.core.jvfs.db.impl.facade.data"
factory-def="org.fugerit.java.core.jvfs.db.daogen.facade.JvfsLogicFacade"
factory-data-impl="org.fugerit.java.core.jvfs.db.daogen.facade.impl.JvfsDataLogicFacade"
package-junit4-model="org.fugerit.java.core.jvfs.db.daogen.junit4test.model"
dao-helper-ng-mode="enabled"
dao-wrapper-ng-mode="enabled"
dao-finder-ng-mode="enabled"
check-empty-interface="1"
>

Expand Down

0 comments on commit 131ade1

Please sign in to comment.