Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32343

Re: JPA and extra fields

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: JPA and extra fields
Date 2015-08-17 22:47 +0000
Organization A noiseless patient Spider
Message-ID <mqto96$2ks$1@dont-email.me> (permalink)
References (2 earlier) <87r3n2sact.fsf@Equus.decebal.nl> <mqsh70$s82$1@dont-email.me> <87io8ert0x.fsf@Equus.decebal.nl> <mqt7uh$ga1$1@dont-email.me> <87bne5sopd.fsf@Equus.decebal.nl>

Show all headers | View raw


On Mon, 17 Aug 2015 21:24:30 +0200, Cecil Westerhof wrote:

> Luckily I only have to take care of the Java code. ;-)
>
Sure. I wasn't saying you should be using it, just trying to explain why 
'boolean' flags have ended up being stored as char(1) fields in the 
database. I always find I can deal with a non-intuitive approach if I 
know its background: this often makes the rationale for doing it that way 
a lot clearer. Back when I was grinding out COBOL on mainframes we often 
ended up storing control flags as single character fields that were set 
to Y or N of only because it made file dumps easier to read (0/1 values 
tend to disapear from view in a record containing mainly numeric fields.

I'm assuming that the COBOL part of the system is rather older than the 
Java bits. Is this correct?
 
> 
> By the way, through setter and getter functions I can work with a
> boolean in Java.
>
Yep. Its as good a way as any of handling the conversion.

Recently I've been doing a bit of work with ICG log files. The IGC 
standard says that a logfile is a set of records, each represented as a 
CRLF terminated line containing fixed length ASCII strings. So, the easy 
way to deal with them in Java is to convert a log file to and from an 
internal Java format that stores it as a list of class instances (one per 
record type), with each class using 'natural' Java ways of storing the 
fields (Date, String, int, etc).


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

JPA and extra fields Cecil Westerhof <Cecil@decebal.nl> - 2015-08-13 20:12 +0200
  Re: JPA and extra fields Eternal Hope <laughingspam99@gmail.com> - 2015-08-13 20:29 +0100
    Re: JPA and extra fields Cecil Westerhof <Cecil@decebal.nl> - 2015-08-17 07:40 +0200
  Re: JPA and extra fields Arne Vajhøj <arne@vajhoej.dk> - 2015-08-13 22:30 -0400
    Re: JPA and extra fields Cecil Westerhof <Cecil@decebal.nl> - 2015-08-17 08:22 +0200
      Re: JPA and extra fields Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-17 11:40 +0000
        Re: JPA and extra fields Cecil Westerhof <Cecil@decebal.nl> - 2015-08-17 14:36 +0200
          Re: JPA and extra fields Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-17 18:08 +0000
            Re: JPA and extra fields Cecil Westerhof <Cecil@decebal.nl> - 2015-08-17 21:24 +0200
              Re: JPA and extra fields Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-17 22:47 +0000
                Re: JPA and extra fields Cecil Westerhof <Cecil@decebal.nl> - 2015-08-19 11:32 +0200
          Re: JPA and extra fields Arne Vajhøj <arne@vajhoej.dk> - 2015-08-17 19:48 -0400
        Re: JPA and extra fields Eternal Hope <laughingspam99@gmail.com> - 2015-08-18 06:25 +0100
          Re: JPA and extra fields Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-18 10:49 +0000
            Re: JPA and extra fields Eternal Hope <laughingspam99@gmail.com> - 2015-08-19 09:00 +0100
              Re: JPA and extra fields Cecil Westerhof <Cecil@decebal.nl> - 2015-08-19 11:36 +0200
                Re: JPA and extra fields Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-19 10:48 +0000
      Re: JPA and extra fields Arne Vajhøj <arne@vajhoej.dk> - 2015-08-17 19:46 -0400
        Re: JPA and extra fields Cecil Westerhof <Cecil@decebal.nl> - 2015-08-19 11:28 +0200
    Re: JPA and extra fields Cecil Westerhof <Cecil@decebal.nl> - 2015-08-19 11:53 +0200
      Re: JPA and extra fields Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-19 10:51 +0000
        Re: JPA and extra fields Cecil Westerhof <Cecil@decebal.nl> - 2015-08-19 13:14 +0200
          Re: JPA and extra fields Cecil Westerhof <Cecil@decebal.nl> - 2015-08-19 14:19 +0200
      Re: JPA and extra fields Arne Vajhøj <arne@vajhoej.dk> - 2015-08-19 19:13 -0400
  Re: JPA and extra fields Silvio <silvio@internet.com> - 2015-08-20 03:49 +0200

csiph-web